From: Jani Nikula <jani.nikula@intel.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>, dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, linux-media@vger.kernel.org
Subject: Re: [Intel-gfx] [PATCH 4/6] drm/cec: add drm_dp_cec_attach() as the non-edid version of set edid
Date: Wed, 30 Aug 2023 13:23:43 +0300 [thread overview]
Message-ID: <87edjk25hs.fsf@intel.com> (raw)
In-Reply-To: <8b6af8fa-8f43-1f68-4f9f-399576d61153@xs4all.nl>
On Wed, 30 Aug 2023, Hans Verkuil <hverkuil-cisco@xs4all.nl> wrote:
> On 24/08/2023 15:46, Jani Nikula wrote:
>> Connectors have source physical address available in display
>> info. There's no need to parse the EDID again for this. Add
>> drm_dp_cec_attach() to do this.
>>
>> Seems like the set_edid/unset_edid naming is a bit specific now that
>> there's no need to pass the EDID at all, so aim for attach/detach going
>> forward.
>>
>> Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
>> Cc: linux-media@vger.kernel.org
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>> drivers/gpu/drm/display/drm_dp_cec.c | 22 +++++++++++++++++++---
>> include/drm/display/drm_dp_helper.h | 6 ++++++
>> 2 files changed, 25 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/display/drm_dp_cec.c b/drivers/gpu/drm/display/drm_dp_cec.c
>> index ae39dc794190..da7a7d357446 100644
>> --- a/drivers/gpu/drm/display/drm_dp_cec.c
>> +++ b/drivers/gpu/drm/display/drm_dp_cec.c
>> @@ -297,7 +297,7 @@ static void drm_dp_cec_unregister_work(struct work_struct *work)
>> * were unchanged and just update the CEC physical address. Otherwise
>> * unregister the old CEC adapter and create a new one.
>> */
>> -void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid)
>> +void drm_dp_cec_attach(struct drm_dp_aux *aux, u16 source_physical_address)
>> {
>> struct drm_connector *connector = aux->cec.connector;
>> u32 cec_caps = CEC_CAP_DEFAULTS | CEC_CAP_NEEDS_HPD |
>> @@ -339,7 +339,7 @@ void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid)
>> if (aux->cec.adap->capabilities == cec_caps &&
>> aux->cec.adap->available_log_addrs == num_las) {
>> /* Unchanged, so just set the phys addr */
>> - cec_s_phys_addr_from_edid(aux->cec.adap, edid);
>> + cec_s_phys_addr(adap, source_physical_address, false);
>
> As the kernel test robot indicated, this does not compile, this should
> be aux->cec.adap.
>
>> goto unlock;
>> }
>> /*
>> @@ -370,11 +370,27 @@ void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid)
>> * from drm_dp_cec_register_connector() edid == NULL, so in
>> * that case the phys addr is just invalidated.
>> */
>> - cec_s_phys_addr_from_edid(aux->cec.adap, edid);
>> + cec_s_phys_addr(adap, source_physical_address, false);
>> }
>> unlock:
>> mutex_unlock(&aux->cec.lock);
>> }
>> +EXPORT_SYMBOL(drm_dp_cec_attach);
>> +
>> +/*
>> + * Note: Prefer calling drm_dp_cec_attach() with
>> + * connector->display_info.source_physical_address if possible.
>> + */
>> +void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid)
>> +{
>> + u16 source_physical_address = CEC_PHYS_ADDR_INVALID;
>> +
>> + if (edid && edid->extensions)
>
> And this source needs to include <drm/drm_edid.h>, also as found by
> the kernel test robot.
Yes, very embarrassing, I sent the v2 in reply [1].
BR,
Jani.
[1] https://patchwork.freedesktop.org/patch/msgid/20230825130120.1250089-1-jani.nikula@intel.com
>
> Regards,
>
> Hans
>
>> + pa = cec_get_edid_phys_addr((const u8 *)edid,
>> + EDID_LENGTH * (edid->extensions + 1), NULL);
>> +
>> + drm_dp_cec_attach(aux, source_physical_address);
>> +}
>> EXPORT_SYMBOL(drm_dp_cec_set_edid);
>>
>> /*
>> diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h
>> index 86f24a759268..3369104e2d25 100644
>> --- a/include/drm/display/drm_dp_helper.h
>> +++ b/include/drm/display/drm_dp_helper.h
>> @@ -699,6 +699,7 @@ void drm_dp_cec_irq(struct drm_dp_aux *aux);
>> void drm_dp_cec_register_connector(struct drm_dp_aux *aux,
>> struct drm_connector *connector);
>> void drm_dp_cec_unregister_connector(struct drm_dp_aux *aux);
>> +void drm_dp_cec_attach(struct drm_dp_aux *aux, u16 source_physical_address);
>> void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid);
>> void drm_dp_cec_unset_edid(struct drm_dp_aux *aux);
>> #else
>> @@ -716,6 +717,11 @@ static inline void drm_dp_cec_unregister_connector(struct drm_dp_aux *aux)
>> {
>> }
>>
>> +static inline void drm_dp_cec_attach(struct drm_dp_aux *aux,
>> + u16 source_physical_address)
>> +{
>> +}
>> +
>> static inline void drm_dp_cec_set_edid(struct drm_dp_aux *aux,
>> const struct edid *edid)
>> {
>
--
Jani Nikula, Intel Open Source Graphics Center
WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@intel.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>, dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, linux-media@vger.kernel.org
Subject: Re: [PATCH 4/6] drm/cec: add drm_dp_cec_attach() as the non-edid version of set edid
Date: Wed, 30 Aug 2023 13:23:43 +0300 [thread overview]
Message-ID: <87edjk25hs.fsf@intel.com> (raw)
In-Reply-To: <8b6af8fa-8f43-1f68-4f9f-399576d61153@xs4all.nl>
On Wed, 30 Aug 2023, Hans Verkuil <hverkuil-cisco@xs4all.nl> wrote:
> On 24/08/2023 15:46, Jani Nikula wrote:
>> Connectors have source physical address available in display
>> info. There's no need to parse the EDID again for this. Add
>> drm_dp_cec_attach() to do this.
>>
>> Seems like the set_edid/unset_edid naming is a bit specific now that
>> there's no need to pass the EDID at all, so aim for attach/detach going
>> forward.
>>
>> Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
>> Cc: linux-media@vger.kernel.org
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>> drivers/gpu/drm/display/drm_dp_cec.c | 22 +++++++++++++++++++---
>> include/drm/display/drm_dp_helper.h | 6 ++++++
>> 2 files changed, 25 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/display/drm_dp_cec.c b/drivers/gpu/drm/display/drm_dp_cec.c
>> index ae39dc794190..da7a7d357446 100644
>> --- a/drivers/gpu/drm/display/drm_dp_cec.c
>> +++ b/drivers/gpu/drm/display/drm_dp_cec.c
>> @@ -297,7 +297,7 @@ static void drm_dp_cec_unregister_work(struct work_struct *work)
>> * were unchanged and just update the CEC physical address. Otherwise
>> * unregister the old CEC adapter and create a new one.
>> */
>> -void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid)
>> +void drm_dp_cec_attach(struct drm_dp_aux *aux, u16 source_physical_address)
>> {
>> struct drm_connector *connector = aux->cec.connector;
>> u32 cec_caps = CEC_CAP_DEFAULTS | CEC_CAP_NEEDS_HPD |
>> @@ -339,7 +339,7 @@ void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid)
>> if (aux->cec.adap->capabilities == cec_caps &&
>> aux->cec.adap->available_log_addrs == num_las) {
>> /* Unchanged, so just set the phys addr */
>> - cec_s_phys_addr_from_edid(aux->cec.adap, edid);
>> + cec_s_phys_addr(adap, source_physical_address, false);
>
> As the kernel test robot indicated, this does not compile, this should
> be aux->cec.adap.
>
>> goto unlock;
>> }
>> /*
>> @@ -370,11 +370,27 @@ void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid)
>> * from drm_dp_cec_register_connector() edid == NULL, so in
>> * that case the phys addr is just invalidated.
>> */
>> - cec_s_phys_addr_from_edid(aux->cec.adap, edid);
>> + cec_s_phys_addr(adap, source_physical_address, false);
>> }
>> unlock:
>> mutex_unlock(&aux->cec.lock);
>> }
>> +EXPORT_SYMBOL(drm_dp_cec_attach);
>> +
>> +/*
>> + * Note: Prefer calling drm_dp_cec_attach() with
>> + * connector->display_info.source_physical_address if possible.
>> + */
>> +void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid)
>> +{
>> + u16 source_physical_address = CEC_PHYS_ADDR_INVALID;
>> +
>> + if (edid && edid->extensions)
>
> And this source needs to include <drm/drm_edid.h>, also as found by
> the kernel test robot.
Yes, very embarrassing, I sent the v2 in reply [1].
BR,
Jani.
[1] https://patchwork.freedesktop.org/patch/msgid/20230825130120.1250089-1-jani.nikula@intel.com
>
> Regards,
>
> Hans
>
>> + pa = cec_get_edid_phys_addr((const u8 *)edid,
>> + EDID_LENGTH * (edid->extensions + 1), NULL);
>> +
>> + drm_dp_cec_attach(aux, source_physical_address);
>> +}
>> EXPORT_SYMBOL(drm_dp_cec_set_edid);
>>
>> /*
>> diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h
>> index 86f24a759268..3369104e2d25 100644
>> --- a/include/drm/display/drm_dp_helper.h
>> +++ b/include/drm/display/drm_dp_helper.h
>> @@ -699,6 +699,7 @@ void drm_dp_cec_irq(struct drm_dp_aux *aux);
>> void drm_dp_cec_register_connector(struct drm_dp_aux *aux,
>> struct drm_connector *connector);
>> void drm_dp_cec_unregister_connector(struct drm_dp_aux *aux);
>> +void drm_dp_cec_attach(struct drm_dp_aux *aux, u16 source_physical_address);
>> void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid);
>> void drm_dp_cec_unset_edid(struct drm_dp_aux *aux);
>> #else
>> @@ -716,6 +717,11 @@ static inline void drm_dp_cec_unregister_connector(struct drm_dp_aux *aux)
>> {
>> }
>>
>> +static inline void drm_dp_cec_attach(struct drm_dp_aux *aux,
>> + u16 source_physical_address)
>> +{
>> +}
>> +
>> static inline void drm_dp_cec_set_edid(struct drm_dp_aux *aux,
>> const struct edid *edid)
>> {
>
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2023-08-30 10:23 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 13:46 [Intel-gfx] [PATCH 0/6] drm, cec and edid updates Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-24 13:46 ` [Intel-gfx] [PATCH 1/6] drm/edid: add drm_edid_is_digital() Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-31 17:23 ` [Intel-gfx] " Ville Syrjälä
2023-08-31 17:23 ` Ville Syrjälä
2023-08-31 17:23 ` Ville Syrjälä
2023-09-01 19:26 ` [Intel-gfx] " Alex Deucher
2023-09-01 19:26 ` Alex Deucher
2023-09-01 19:26 ` Alex Deucher
2023-09-04 10:43 ` [Intel-gfx] " Jani Nikula
2023-09-04 10:43 ` Jani Nikula
2023-09-04 10:43 ` Jani Nikula
2023-08-24 13:46 ` [Intel-gfx] [PATCH 2/6] drm/i915/display: use drm_edid_is_digital() Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-31 17:24 ` [Intel-gfx] " Ville Syrjälä
2023-08-31 17:24 ` Ville Syrjälä
2023-08-24 13:46 ` [Intel-gfx] [PATCH 3/6] drm/edid: parse source physical address Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-30 9:54 ` [Intel-gfx] " Hans Verkuil
2023-08-30 9:54 ` Hans Verkuil
2023-08-24 13:46 ` [Intel-gfx] [PATCH 4/6] drm/cec: add drm_dp_cec_attach() as the non-edid version of set edid Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-25 11:23 ` [Intel-gfx] " kernel test robot
2023-08-25 11:23 ` kernel test robot
2023-08-25 11:23 ` kernel test robot
2023-08-25 11:23 ` kernel test robot
2023-08-25 13:01 ` [Intel-gfx] [PATCH v2] " Jani Nikula
2023-08-25 13:01 ` Jani Nikula
2023-08-25 13:01 ` Jani Nikula
2023-08-30 10:26 ` [Intel-gfx] " Hans Verkuil
2023-08-30 10:26 ` Hans Verkuil
2023-08-30 9:57 ` [Intel-gfx] [PATCH 4/6] " Hans Verkuil
2023-08-30 9:57 ` Hans Verkuil
2023-08-30 10:23 ` Jani Nikula [this message]
2023-08-30 10:23 ` Jani Nikula
2023-08-24 13:46 ` [Intel-gfx] [PATCH 5/6] drm/i915/cec: switch to setting physical address directly Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-30 9:57 ` [Intel-gfx] " Hans Verkuil
2023-08-30 9:57 ` Hans Verkuil
2023-08-24 13:46 ` [Intel-gfx] [PATCH 6/6] media: cec: core: add note about *_from_edid() function usage in drm Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-24 13:46 ` Jani Nikula
2023-08-30 10:03 ` [Intel-gfx] " Hans Verkuil
2023-08-30 10:03 ` Hans Verkuil
2023-08-31 10:52 ` [Intel-gfx] " Jani Nikula
2023-08-31 10:52 ` Jani Nikula
2023-08-31 10:51 ` [Intel-gfx] [PATCH v2] " Jani Nikula
2023-08-31 10:51 ` Jani Nikula
2023-08-31 11:38 ` [Intel-gfx] " Hans Verkuil
2023-08-31 11:38 ` Hans Verkuil
2023-08-24 19:59 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm, cec and edid updates Patchwork
2023-08-24 20:16 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-08-25 9:10 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-08-25 16:17 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm, cec and edid updates (rev2) Patchwork
2023-08-25 16:35 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-08-26 8:15 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-08-31 14:29 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm, cec and edid updates (rev3) Patchwork
2023-08-31 14:44 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-08-31 18:48 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-08-31 18:51 ` [Intel-gfx] [PATCH 0/6] drm, cec and edid updates Jani Nikula
2023-08-31 18:51 ` Jani Nikula
2023-08-31 18:51 ` Jani Nikula
2023-08-31 21:32 ` [Intel-gfx] " Hans Verkuil
2023-08-31 21:32 ` Hans Verkuil
2023-09-01 7:24 ` [Intel-gfx] " Maxime Ripard
2023-09-01 7:24 ` Maxime Ripard
2023-09-01 7:24 ` Maxime Ripard
2023-09-01 8:57 ` [Intel-gfx] " Jani Nikula
2023-09-01 8:57 ` Jani Nikula
2023-09-01 8:57 ` 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=87edjk25hs.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-media@vger.kernel.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 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.