Message ID | 20200226043041.289764-2-paul@crapouillou.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2,1/3] gpu/drm: ingenic: Add trick to support 16bpp on 24-bit panels | expand |
On Wed, Feb 26, 2020 at 01:30:40AM -0300, Paul Cercueil wrote: > The fbdev emulation is only ever used on Ingenic SoCs to run old SDL1 > based games at 16bpp (rgb565). Recent applications generally talk to > DRM directly, and can request their favourite pixel format; so we can > make everybody happy by switching the emulated fbdev to 16bpp. > > v2: No change > > Signed-off-by: Paul Cercueil <paul@crapouillou.net> > --- > drivers/gpu/drm/ingenic/ingenic-drm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c > index 5493a80d7d2f..3f8cc98d41fe 100644 > --- a/drivers/gpu/drm/ingenic/ingenic-drm.c > +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c > @@ -807,7 +807,7 @@ static int ingenic_drm_probe(struct platform_device *pdev) > goto err_devclk_disable; > } > > - ret = drm_fbdev_generic_setup(drm, 32); > + ret = drm_fbdev_generic_setup(drm, 16); This will conflict with Thomas' work to remove the error code, so might need a rebase. Now for the patch itself your supposed to set drm_device->mode_config.preferred_bpp and leave this here as 0. That way userspace can also know what's the best option. Maybe in the future we could auto-compute the preferred_bpp from just taking the first format of the first primary plane, but atm not there. With the above change: Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > if (ret) > dev_warn(dev, "Unable to start fbdev emulation: %i", ret); > > -- > 2.25.0 >
diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c index 5493a80d7d2f..3f8cc98d41fe 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c @@ -807,7 +807,7 @@ static int ingenic_drm_probe(struct platform_device *pdev) goto err_devclk_disable; } - ret = drm_fbdev_generic_setup(drm, 32); + ret = drm_fbdev_generic_setup(drm, 16); if (ret) dev_warn(dev, "Unable to start fbdev emulation: %i", ret);
The fbdev emulation is only ever used on Ingenic SoCs to run old SDL1 based games at 16bpp (rgb565). Recent applications generally talk to DRM directly, and can request their favourite pixel format; so we can make everybody happy by switching the emulated fbdev to 16bpp. v2: No change Signed-off-by: Paul Cercueil <paul@crapouillou.net> --- drivers/gpu/drm/ingenic/ingenic-drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)