dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Javier Martinez Canillas <javierm@redhat.com>,
	daniel@ffwll.ch, airlied@gmail.com, mripard@kernel.org,
	maarten.lankhorst@linux.intel.com, xinliang.liu@linaro.org,
	tiantao6@hisilicon.com, jstultz@google.com,
	kong.kongxinwei@hisilicon.com, puck.chen@hisilicon.com,
	paul.kocialkowski@bootlin.com, airlied@redhat.com,
	kraxel@redhat.com
Cc: dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH 2/7] drm/logicvc: Fix preferred fbdev cpp
Date: Fri, 18 Nov 2022 14:22:21 +0100	[thread overview]
Message-ID: <10c809cb-2ea9-273c-bfd2-a267e6219f22@suse.de> (raw)
In-Reply-To: <521e43bb-0c76-f3b7-aa78-8ed97edce613@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 2810 bytes --]

Hi

Am 18.11.22 um 14:08 schrieb Javier Martinez Canillas:
> On 11/16/22 17:09, Thomas Zimmermann wrote:
>> Logicvc can have different values for the preferred color depth. Set
>> the fbdev bpp value depending on the runtime value.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>   drivers/gpu/drm/logicvc/logicvc_drm.c | 14 +++++++++++++-
>>   1 file changed, 13 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/logicvc/logicvc_drm.c b/drivers/gpu/drm/logicvc/logicvc_drm.c
>> index 9de24d9f0c963..d9cd5d967e31f 100644
>> --- a/drivers/gpu/drm/logicvc/logicvc_drm.c
>> +++ b/drivers/gpu/drm/logicvc/logicvc_drm.c
>> @@ -301,6 +301,7 @@ static int logicvc_drm_probe(struct platform_device *pdev)
>>   	struct regmap *regmap = NULL;
>>   	struct resource res;
>>   	void __iomem *base;
>> +	unsigned int preferred_bpp;
>>   	int irq;
>>   	int ret;
>>   
>> @@ -438,7 +439,18 @@ static int logicvc_drm_probe(struct platform_device *pdev)
>>   		goto error_mode;
>>   	}
>>   
>> -	drm_fbdev_generic_setup(drm_dev, drm_dev->mode_config.preferred_depth);
>> +	switch (drm_dev->mode_config.preferred_depth) {
>> +	case 15:
> 
> Why could have 15? IIUC the formats supported by this driver are:
> 
> static uint32_t logicvc_layer_formats_rgb16[] = {
> 	DRM_FORMAT_RGB565,
> 	DRM_FORMAT_BGR565,
> 	DRM_FORMAT_INVALID,
> };
> 
> static uint32_t logicvc_layer_formats_rgb24[] = {
> 	DRM_FORMAT_XRGB8888,
> 	DRM_FORMAT_XBGR8888,
> 	DRM_FORMAT_INVALID,
> };
> 
> /*
>   * What we call depth in this driver only counts color components, not alpha.
>   * This allows us to stay compatible with the LogiCVC bistream definitions.
>   */
> static uint32_t logicvc_layer_formats_rgb24_alpha[] = {
> 	DRM_FORMAT_ARGB8888,
> 	DRM_FORMAT_ABGR8888,
> 	DRM_FORMAT_INVALID,
> };
> 
> So shouldn't be just 16, 24 and 32 ?

That makes sense.

> 
>> +	case 16:
>> +		preferred_bpp = 16;
>> +		break;
>> +	case 24:
>> +	case 32:
>> +	default:
>> +		preferred_bpp = 32;
>> +		break;
> 
> I'm also not sure if this is needed. Since IIUC in logicvc_mode_init() the
> driver does:
> 
> 	preferred_depth = layer_primary->formats->depth;
> 
> 	/* DRM counts alpha in depth, our driver doesn't. */
> 	if (layer_primary->formats->alpha)
> 		preferred_depth += 8;
> 
> 	...
> 	mode_config->preferred_depth = preferred_depth;
> 
> So it seems this patch is not needed? Unless I'm misunderstanding the code.

The driver uses XRGB8888, so the 24-bit color depth has a 32-bit bpp 
value. Hence the switch.

Best regards
Thomas

> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2022-11-18 13:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 16:09 [PATCH 0/7] drm: Fix the color-depth/bpp confusion Thomas Zimmermann
2022-11-16 16:09 ` [PATCH 1/7] drm/hisilicon/hibmc: Fix preferred depth and bpp Thomas Zimmermann
2022-11-18 12:52   ` Javier Martinez Canillas
2022-11-18 13:18     ` Thomas Zimmermann
2022-11-18 13:31       ` Javier Martinez Canillas
2022-11-16 16:09 ` [PATCH 2/7] drm/logicvc: Fix preferred fbdev cpp Thomas Zimmermann
2022-11-18 13:08   ` Javier Martinez Canillas
2022-11-18 13:22     ` Thomas Zimmermann [this message]
2022-11-18 13:41       ` Javier Martinez Canillas
2022-11-18 13:48         ` Thomas Zimmermann
2022-11-18 14:01           ` Javier Martinez Canillas
2022-11-16 16:09 ` [PATCH 3/7] drm/cirrus: Decouple fbdev bpp value from color depth Thomas Zimmermann
2022-11-18 13:44   ` Javier Martinez Canillas
2022-11-16 16:09 ` [PATCH 4/7] drm/ofdrm: Set preferred depth from format of scanout buffer Thomas Zimmermann
2022-11-18 14:06   ` Javier Martinez Canillas
2022-11-16 16:09 ` [PATCH 5/7] drm/simpledrm: " Thomas Zimmermann
2022-11-18 14:07   ` Javier Martinez Canillas
2022-11-16 16:09 ` [PATCH 6/7] drm/solomon: Set preferred color depth and bpp to the correct values Thomas Zimmermann
2022-11-18 14:08   ` Javier Martinez Canillas
2022-11-16 16:09 ` [PATCH 7/7] drm/fb-helper: Don't use the preferred depth for the BPP default Thomas Zimmermann
2022-11-18 14:12   ` Javier Martinez Canillas
2022-11-22 14:43   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10c809cb-2ea9-273c-bfd2-a267e6219f22@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=jstultz@google.com \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=kraxel@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=puck.chen@hisilicon.com \
    --cc=tiantao6@hisilicon.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xinliang.liu@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox