All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Thomas Zimmermann <tzimmermann@suse.de>, dri-devel@lists.freedesktop.org
Cc: Hans de Goede <hdegoede@redhat.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>
Subject: Re: [PATCH 6/6] drm/tiny/gm12u320: convert to struct drm_edid
Date: Wed, 28 Aug 2024 16:35:50 +0300	[thread overview]
Message-ID: <87seuoydl5.fsf@intel.com> (raw)
In-Reply-To: <a1e0ddbc-30b5-4303-9d1a-99f51c44d679@suse.de>

On Wed, 28 Aug 2024, Thomas Zimmermann <tzimmermann@suse.de> wrote:
> Hi
>
> Am 22.08.24 um 19:42 schrieb Jani Nikula:
>> Prefer the struct drm_edid based functions for allocating the EDID and
>> updating the connector.
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>
>> ---
>>
>> Cc: Hans de Goede <hdegoede@redhat.com>
>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Cc: Maxime Ripard <mripard@kernel.org>
>> Cc: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: dri-devel@lists.freedesktop.org
>> ---
>>   drivers/gpu/drm/tiny/gm12u320.c | 13 ++++++++++---
>>   1 file changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
>> index e0defb1d134f..0bd7707c053e 100644
>> --- a/drivers/gpu/drm/tiny/gm12u320.c
>> +++ b/drivers/gpu/drm/tiny/gm12u320.c
>> @@ -464,7 +464,7 @@ static int gm12u320_set_ecomode(struct gm12u320_device *gm12u320)
>>    * Note this assumes this driver is only ever used with the Acer C120, if we
>>    * add support for other devices the vendor and model should be parameterized.
>>    */
>> -static struct edid gm12u320_edid = {
>> +static const struct edid gm12u320_edid = {
>>   	.header		= { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 },
>>   	.mfg_id		= { 0x04, 0x72 },	/* "ACR" */
>>   	.prod_code	= { 0x20, 0xc1 },	/* C120h */
>> @@ -523,8 +523,15 @@ static struct edid gm12u320_edid = {
>>   
>>   static int gm12u320_conn_get_modes(struct drm_connector *connector)
>>   {
>> -	drm_connector_update_edid_property(connector, &gm12u320_edid);
>> -	return drm_add_edid_modes(connector, &gm12u320_edid);
>> +	const struct drm_edid *drm_edid;
>> +	int count;
>> +
>> +	drm_edid = drm_edid_alloc(&gm12u320_edid, sizeof(gm12u320_edid));
>
> Wouldn't it be better to use drm_edid_read_custom() to get the 
> connector's edid override, if any?

It would, no doubt. But it's more work, and the conversion is more error
prone. I don't have the devices to test any of this, and I don't see
many people jumping in to help with that either.

So I'm opting for the minimum but positive incremental improvements with
the drm_edid conversions.

BR,
Jani.


>
> Best regards
> Thomas
>
>> +	drm_edid_connector_update(connector, drm_edid);
>> +	count = drm_edid_connector_add_modes(connector);
>> +	drm_edid_free(drm_edid);
>> +
>> +	return count;
>>   }
>>   
>>   static const struct drm_connector_helper_funcs gm12u320_conn_helper_funcs = {

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-08-28 13:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22 17:42 [PATCH 0/6] drm: conversions to struct drm_edid Jani Nikula
2024-08-22 17:42 ` [PATCH 1/6] drm/sti/sti_hdmi: convert " Jani Nikula
2024-08-22 17:42 ` [PATCH 2/6] drm/exynos: hdmi: use display_info for printing display dimensions Jani Nikula
2024-08-28 12:44   ` Daniel Vetter
2024-08-22 17:42 ` [PATCH 3/6] drm/exynos: hdmi: convert to struct drm_edid Jani Nikula
2024-08-28 12:45   ` Daniel Vetter
2024-08-22 17:42 ` [PATCH 4/6] drm/tegra: " Jani Nikula
2024-08-28 12:46   ` Daniel Vetter
2024-08-29  8:55   ` Thierry Reding
2024-08-29 11:43     ` Jani Nikula
2024-08-22 17:42 ` [PATCH 5/6] drm/ipuv3/parallel: " Jani Nikula
2024-08-28 12:48   ` Daniel Vetter
2024-08-22 17:42 ` [PATCH 6/6] drm/tiny/gm12u320: " Jani Nikula
2024-08-28 12:49   ` Daniel Vetter
2024-08-28 12:52   ` Thomas Zimmermann
2024-08-28 13:35     ` Jani Nikula [this message]
2024-08-29 11:44 ` [PATCH 0/6] drm: conversions " Jani Nikula
2024-09-04  2:21   ` 대인기/Tizen Platform Lab(SR)/삼성전자
2024-09-04  8:32     ` Jani Nikula

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=87seuoydl5.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.