]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/hisilicon: hibmc: Don't overwrite fb helper surface depth
authorJohn Garry <john.garry@huawei.com>
Fri, 21 Sep 2018 17:25:26 +0000 (01:25 +0800)
committerXinliang Liu <xinliang.liu@linaro.org>
Wed, 26 Sep 2018 03:40:06 +0000 (11:40 +0800)
Currently the driver overwrites the surface depth provided by the fb
helper to give an invalid bpp/surface depth combination.

This has been exposed by commit 70109354fed2 ("drm: Reject unknown legacy
bpp and depth for drm_mode_addfb ioctl"), which now causes the driver to
fail to probe.

Fix by not overwriting the surface depth.

Fixes: d1667b86795a ("drm/hisilicon/hibmc: Add support for frame buffer")
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Xinliang Liu <z.liuxinliang@hisilicon.com>
Signed-off-by: Xinliang Liu <z.liuxinliang@hisilicon.com>
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c

index 8bd29075ae4ebb9c0d865d00b92d7f5a7be9e163..edcca17615001cb4ba37e7ac3601d731189f36c8 100644 (file)
@@ -71,7 +71,6 @@ static int hibmc_drm_fb_create(struct drm_fb_helper *helper,
        DRM_DEBUG_DRIVER("surface width(%d), height(%d) and bpp(%d)\n",
                         sizes->surface_width, sizes->surface_height,
                         sizes->surface_bpp);
-       sizes->surface_depth = 32;
 
        bytes_per_pixel = DIV_ROUND_UP(sizes->surface_bpp, 8);