Skip to content

Commit ab78c74

Browse files
johnkeepingmmind
authored andcommitted
drm/rockchip: fix fbdev on non-IOMMU devices
When switching to the generic fbdev infrastructure, it was missed that framebuffers were created with the alloc_kmap parameter to rockchip_gem_create_object() set to true. The generic infrastructure calls this via the .dumb_create() driver operation and thus creates a buffer without an associated kmap. alloc_kmap only makes a difference on devices without an IOMMU, but when it is missing rockchip_gem_prime_vmap() fails and the framebuffer cannot be used. Detect the case where a buffer is being allocated for the framebuffer and ensure a kernel mapping is created in this case. Fixes: 24af7c3 ("drm/rockchip: use generic fbdev setup") Reported-by: Johan Jonker <jbx6244@gmail.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: John Keeping <john@metanate.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20221020181248.2497065-1-john@metanate.com
1 parent 81e592f commit ab78c74

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/gpu/drm/rockchip/rockchip_drm_gem.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,12 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv,
364364
{
365365
struct rockchip_gem_object *rk_obj;
366366
struct drm_gem_object *obj;
367+
bool is_framebuffer;
367368
int ret;
368369

369-
rk_obj = rockchip_gem_create_object(drm, size, false);
370+
is_framebuffer = drm->fb_helper && file_priv == drm->fb_helper->client.file;
371+
372+
rk_obj = rockchip_gem_create_object(drm, size, is_framebuffer);
370373
if (IS_ERR(rk_obj))
371374
return ERR_CAST(rk_obj);
372375

0 commit comments

Comments
 (0)