In message: [linux-yocto] drm/tilcdc: Set preferred depth
on 19/03/2024 Kevin Hao wrote:
> The commit c91acda3a380 ("drm/gem: Check for valid formats") adds a
> check for valid pixel formats on drm_gem_fb_create(), but this breaks
> the X server on the beaglebone black board.
>
> We have set 'DefaultDepth' to 16 in our xorg.conf. In the X modesetting
> driver, the drmmode_get_default_bpp() is used to guess the default
> depth/bpp. First it tries to get them via DRM_CAP_DUMB_PREFERRED_DEPTH
> ioctl, and if it fail, then try to create a FB with 'depth = 24' and
> 'bpp = 32' to check whether this depth/dpp is a valid combo. Before the
> kernel commit c91acda3a380, the FB always can be created successfully.
> This will avoid the bpp to be set to 24 forcibly. But after kernel
> commit c91acda3a380, the FB will not be created successfully due to the
> check of the valid pixel format. Then the bpp is set to 24, but the
> 'depth = 16' and 'bpp = 24' combo is not a valid pixel format.
>
> Fix this issue by explicitly setting the preferred_depth in this driver.
> With this change, the modesetting driver would choose the correct
> depth/bpp combo based on our setting in xorg.conf.
>
> Fixes: c91acda3a380 ("drm/gem: Check for valid formats")
> Cc: [email protected]
> Signed-off-by: Kevin Hao <[email protected]>
> Link: https://lore.kernel.org/r/[email protected]/
> ---
> Hi Bruce,
>
> Please merge this onto v6.6/standard/base branch.
>
> This patch is still in review, but it fixes the X malfunction on the
> beaglebone black, so I want it to be merged as soon as possible. There is
> also another patch [1] on the mail list to fix the same issue, but I
> like mine and think it is more suitable for a stable kernel fix. There
> is also no semantic conflict between these two patches.
The direction sounds fine to me.
I've merged this and will send the SRCREV bump by the end
of the day (I have a bit more testing on unrelated commits)
Bruce
>
> [1]
> https://lore.kernel.org/dri-devel/e7ef6d422365986f49746b596735f7a0b939574d.1710698387.git.frej.drejham...@gmail.com/T/#mf85946113936134f54807095b92d7c45428f6004
>
> drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> index 2f6eaac7f659..daff3926ab89 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> @@ -269,6 +269,7 @@ static int tilcdc_init(const struct drm_driver *ddrv,
> struct device *dev)
>
> pm_runtime_put_sync(dev);
>
> + ddev->mode_config.preferred_depth = 16;
> if (priv->rev == 1) {
> DBG("Revision 1 LCDC supports only RGB565 format");
> priv->pixelformats = tilcdc_rev1_formats;
> @@ -284,6 +285,7 @@ static int tilcdc_init(const struct drm_driver *ddrv,
> struct device *dev)
> priv->num_pixelformats =
> ARRAY_SIZE(tilcdc_crossed_formats);
> bpp = 32; /* Choose bpp with RGB support for fbdef */
> + ddev->mode_config.preferred_depth = 24;
> } else if (0 == strcmp(str, "straight")) {
> DBG("Configured for straight blue and red wires");
> priv->pixelformats = tilcdc_straight_formats;
> --
> 2.44.0
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13701):
https://lists.yoctoproject.org/g/linux-yocto/message/13701
Mute This Topic: https://lists.yoctoproject.org/mt/105016038/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-