dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Thomas Zimmermann <tzimmermann@suse.de>, dri-devel@lists.freedesktop.org
Cc: Xinliang Liu <xinliang.liu@linaro.org>,
	Tian Tao <tiantao6@hisilicon.com>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Yongqin Liu <yongqin.liu@linaro.org>,
	John Stultz <jstultz@google.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>
Subject: Re: [PATCH 05/11] drm/hisilicon/hibmc: convert to struct drm_edid
Date: Wed, 15 May 2024 15:34:02 +0300	[thread overview]
Message-ID: <87jzjvckzp.fsf@intel.com> (raw)
In-Reply-To: <784e277b-ef15-4c82-9720-c9a03d53f3c6@suse.de>

On Tue, 14 May 2024, Thomas Zimmermann <tzimmermann@suse.de> wrote:
> Hi
>
> Am 14.05.24 um 14:55 schrieb Jani Nikula:
>> Prefer the struct drm_edid based functions for reading the EDID and
>> updating the connector.
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>
>> ---
>>
>> Cc: Xinliang Liu <xinliang.liu@linaro.org>
>> Cc: Tian Tao <tiantao6@hisilicon.com>
>> Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
>> Cc: Sumit Semwal <sumit.semwal@linaro.org>
>> Cc: Yongqin Liu <yongqin.liu@linaro.org>
>> Cc: John Stultz <jstultz@google.com>
>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Cc: Maxime Ripard <mripard@kernel.org>
>> Cc: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>   .../gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c    | 17 ++++++++++-------
>>   1 file changed, 10 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
>> index 94e2c573a7af..409c551c92af 100644
>> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
>> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
>> @@ -24,14 +24,16 @@
>>   
>>   static int hibmc_connector_get_modes(struct drm_connector *connector)
>
> Could this function be replaced with a call to 
> drm_connector_helper_get_modes()? With the patch, the only difference is 
> the call to the _noedid() function, which the DRM core does 
> automatically. There will still be a difference in the maximum 
> resolution, but standardizing on 1024x768 seems preferable to me.

Looks like it might work, but personally, I'm trying to shy away from
any further cleanups than just switching to struct drm_edid. I've got my
plate pretty full already.

BR,
Jani.


>
> Best regards
> Thomas
>
>>   {
>> -	int count;
>> -	void *edid;
>>   	struct hibmc_connector *hibmc_connector = to_hibmc_connector(connector);
>> +	const struct drm_edid *drm_edid;
>> +	int count;
>> +
>> +	drm_edid = drm_edid_read_ddc(connector, &hibmc_connector->adapter);
>>   
>> -	edid = drm_get_edid(connector, &hibmc_connector->adapter);
>> -	if (edid) {
>> -		drm_connector_update_edid_property(connector, edid);
>> -		count = drm_add_edid_modes(connector, edid);
>> +	drm_edid_connector_update(connector, drm_edid);
>> +
>> +	if (drm_edid) {
>> +		count = drm_edid_connector_add_modes(connector);
>>   		if (count)
>>   			goto out;
>>   	}
>> @@ -42,7 +44,8 @@ static int hibmc_connector_get_modes(struct drm_connector *connector)
>>   	drm_set_preferred_mode(connector, 1024, 768);
>>   
>>   out:
>> -	kfree(edid);
>> +	drm_edid_free(drm_edid);
>> +
>>   	return count;
>>   }
>>   

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-05-15 12:34 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14 12:55 [PATCH 00/11] drm: conversions to struct drm_edid Jani Nikula
2024-05-14 12:55 ` [PATCH 01/11] drm/rockchip: cdn-dp: get rid of drm_edid_raw() Jani Nikula
2024-06-24  9:14   ` Daniel Vetter
2024-05-14 12:55 ` [PATCH 02/11] drm/sti/sti_hdmi: convert to struct drm_edid Jani Nikula
2024-06-24  9:22   ` Daniel Vetter
2024-08-15 12:55     ` Jani Nikula
2024-08-19 14:04       ` Daniel Vetter
2024-05-14 12:55 ` [PATCH 03/11] drm/bridge: analogix_dp: " Jani Nikula
2024-05-19 21:38   ` Dmitry Baryshkov
2024-05-14 12:55 ` [PATCH 04/11] drm/exynos: hdmi: " Jani Nikula
2024-06-10  9:02   ` Inki Dae
2024-06-13  7:15     ` Jani Nikula
2024-05-14 12:55 ` [PATCH 05/11] drm/hisilicon/hibmc: " Jani Nikula
2024-05-14 13:07   ` Thomas Zimmermann
2024-05-15 12:34     ` Jani Nikula [this message]
2024-05-15 12:37       ` Thomas Zimmermann
2024-05-14 12:55 ` [PATCH 06/11] drm/loongson/7a1000: " Jani Nikula
2024-05-15 17:37   ` [06/11] " Sui Jingfeng
2024-05-14 12:55 ` [PATCH 07/11] drm/loongson/7a2000: " Jani Nikula
2024-05-15 17:41   ` [07/11] " Sui Jingfeng
2024-05-14 12:55 ` [PATCH 08/11] drm/msm/dp: switch " Jani Nikula
2024-05-19  9:01   ` Dmitry Baryshkov
2024-05-20 12:25     ` Jani Nikula
2024-05-20 12:33       ` Dmitry Baryshkov
2024-05-20 16:07     ` Doug Anderson
2024-05-30 12:45       ` Jani Nikula
2024-05-30 12:48         ` Dmitry Baryshkov
2024-05-14 12:55 ` [PATCH 09/11] drm/tegra: convert " Jani Nikula
2024-06-24  9:29   ` Daniel Vetter
2024-08-22 16:32     ` Jani Nikula
2024-08-27 16:38       ` Daniel Vetter
2024-05-14 12:55 ` [PATCH 10/11] drm/imx/tve: " Jani Nikula
2024-05-19 21:35   ` Dmitry Baryshkov
2024-05-20 13:06     ` Jani Nikula
2024-05-14 12:55 ` [PATCH 11/11] drm/imx/ldb: " Jani Nikula
2024-05-19 21:39   ` Dmitry Baryshkov
2024-06-23  7:14 ` [PATCH 00/11] drm: conversions " Dmitry Baryshkov

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=87jzjvckzp.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jstultz@google.com \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tiantao6@hisilicon.com \
    --cc=tzimmermann@suse.de \
    --cc=xinliang.liu@linaro.org \
    --cc=yongqin.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;
as well as URLs for NNTP newsgroup(s).