All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: "Claudio Suarez" <cssk@net-c.es>,
	dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	linux-tegra@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Pan Xinhui" <Xinhui.Pan@amd.com>,
	"Emma Anholt" <emma@anholt.net>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Patrik Jakobsson" <patrik.r.jakobsson@gmail.com>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Rob Clark" <robdclark@gmail.com>, "Sean Paul" <sean@poorly.run>,
	linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Benjamin Gaignard" <benjamin.gaignard@linaro.org>,
	"Sandy Huang" <hjc@rock-chips.com>,
	heiko@sntech.de, "Andrzej Hajda" <a.hajda@samsung.com>,
	"Neil Armstrong" <narmstrong@baylibre.com>,
	"Robert Foss" <robert.foss@linaro.org>,
	"Ben Skeggs" <bskeggs@redhat.com>,
	nouveau@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 15/15] drm/i915: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
Date: Fri, 15 Oct 2021 18:18:34 +0300	[thread overview]
Message-ID: <874k9iuxit.fsf@intel.com> (raw)
In-Reply-To: <YWl7D9Qnt/Ysk2JI@intel.com>

On Fri, 15 Oct 2021, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Fri, Oct 15, 2021 at 03:44:48PM +0300, Jani Nikula wrote:
>> On Fri, 15 Oct 2021, Claudio Suarez <cssk@net-c.es> wrote:
>> > Once EDID is parsed, the monitor HDMI support information is available
>> > through drm_display_info.is_hdmi. Retriving the same information with
>> > drm_detect_hdmi_monitor() is less efficient. Change to
>> > drm_display_info.is_hdmi where possible.
>> >
>> > This is a TODO task in Documentation/gpu/todo.rst
>> >
>> > Signed-off-by: Claudio Suarez <cssk@net-c.es>
>> > ---
>> >  drivers/gpu/drm/i915/display/intel_connector.c | 5 +++++
>> >  drivers/gpu/drm/i915/display/intel_connector.h | 1 +
>> >  drivers/gpu/drm/i915/display/intel_hdmi.c      | 2 +-
>> >  drivers/gpu/drm/i915/display/intel_sdvo.c      | 3 ++-
>> >  4 files changed, 9 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/display/intel_connector.c b/drivers/gpu/drm/i915/display/intel_connector.c
>> > index 9bed1ccecea0..3346b55df6e1 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_connector.c
>> > +++ b/drivers/gpu/drm/i915/display/intel_connector.c
>> > @@ -213,6 +213,11 @@ int intel_ddc_get_modes(struct drm_connector *connector,
>> >  	return ret;
>> >  }
>> >  
>> > +bool intel_connector_is_hdmi_monitor(struct drm_connector *connector)
>> > +{
>> > +	return connector->display_info.is_hdmi;
>> > +}
>> > +
>> 
>> A helper like this belongs in drm, not i915. Seems useful in other
>> drivers too.
>
> Not sure it's actually helpful for i915. We end up having to root around
> in the display_info in a lot of places anyway. So a helper for single
> boolean seems a bit out of place perhaps.

*shrug*

Maybe it's just my frustration at the lack of interfaces and poking
around in the depths of nested structs and pointer chasing that's coming
through. You just need to change so many things if you want to later
refactor where "is hdmi" comes from and is stored.

Anyway, if a helper is being added like in this series, I think it
should be one helper in drm, not redundant copies in multiple
drivers. Or we should not have the helper(s) at all. One or the other,
not the worst of both worlds.


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: "Claudio Suarez" <cssk@net-c.es>,
	dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	linux-tegra@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Pan Xinhui" <Xinhui.Pan@amd.com>,
	"Emma Anholt" <emma@anholt.net>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Patrik Jakobsson" <patrik.r.jakobsson@gmail.com>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Rob Clark" <robdclark@gmail.com>, "Sean Paul" <sean@poorly.run>,
	linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Benjamin Gaignard" <benjamin.gaignard@linaro.org>,
	"Sandy Huang" <hjc@rock-chips.com>,
	heiko@sntech.de, "Andrzej Hajda" <a.hajda@samsung.com>,
	"Neil Armstrong" <narmstrong@baylibre.com>,
	"Robert Foss" <robert.foss@linaro.org>,
	"Ben Skeggs" <bskeggs@redhat.com>,
	nouveau@lists.freedesktop.org
Subject: Re: [Nouveau] [Intel-gfx] [PATCH 15/15] drm/i915: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
Date: Fri, 15 Oct 2021 18:18:34 +0300	[thread overview]
Message-ID: <874k9iuxit.fsf@intel.com> (raw)
In-Reply-To: <YWl7D9Qnt/Ysk2JI@intel.com>

On Fri, 15 Oct 2021, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Fri, Oct 15, 2021 at 03:44:48PM +0300, Jani Nikula wrote:
>> On Fri, 15 Oct 2021, Claudio Suarez <cssk@net-c.es> wrote:
>> > Once EDID is parsed, the monitor HDMI support information is available
>> > through drm_display_info.is_hdmi. Retriving the same information with
>> > drm_detect_hdmi_monitor() is less efficient. Change to
>> > drm_display_info.is_hdmi where possible.
>> >
>> > This is a TODO task in Documentation/gpu/todo.rst
>> >
>> > Signed-off-by: Claudio Suarez <cssk@net-c.es>
>> > ---
>> >  drivers/gpu/drm/i915/display/intel_connector.c | 5 +++++
>> >  drivers/gpu/drm/i915/display/intel_connector.h | 1 +
>> >  drivers/gpu/drm/i915/display/intel_hdmi.c      | 2 +-
>> >  drivers/gpu/drm/i915/display/intel_sdvo.c      | 3 ++-
>> >  4 files changed, 9 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/display/intel_connector.c b/drivers/gpu/drm/i915/display/intel_connector.c
>> > index 9bed1ccecea0..3346b55df6e1 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_connector.c
>> > +++ b/drivers/gpu/drm/i915/display/intel_connector.c
>> > @@ -213,6 +213,11 @@ int intel_ddc_get_modes(struct drm_connector *connector,
>> >  	return ret;
>> >  }
>> >  
>> > +bool intel_connector_is_hdmi_monitor(struct drm_connector *connector)
>> > +{
>> > +	return connector->display_info.is_hdmi;
>> > +}
>> > +
>> 
>> A helper like this belongs in drm, not i915. Seems useful in other
>> drivers too.
>
> Not sure it's actually helpful for i915. We end up having to root around
> in the display_info in a lot of places anyway. So a helper for single
> boolean seems a bit out of place perhaps.

*shrug*

Maybe it's just my frustration at the lack of interfaces and poking
around in the depths of nested structs and pointer chasing that's coming
through. You just need to change so many things if you want to later
refactor where "is hdmi" comes from and is stored.

Anyway, if a helper is being added like in this series, I think it
should be one helper in drm, not redundant copies in multiple
drivers. Or we should not have the helper(s) at all. One or the other,
not the worst of both worlds.


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2021-10-15 15:19 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15 11:36 [PATCH 00/15] replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Claudio Suarez
2021-10-15 11:36 ` [Nouveau] " Claudio Suarez
2021-10-15 11:36 ` [Intel-gfx] " Claudio Suarez
2021-10-15 11:36 ` [PATCH 01/15] gpu/drm: make drm_add_edid_modes() consistent when updating connector->display_info Claudio Suarez
2021-10-15 11:36   ` [Nouveau] " Claudio Suarez
2021-10-15 11:36   ` [Intel-gfx] " Claudio Suarez
2021-10-15 12:03   ` Ville Syrjälä
2021-10-15 12:03     ` [Intel-gfx] " Ville Syrjälä
2021-10-15 12:03     ` [Nouveau] " Ville Syrjälä
2021-10-15 19:24     ` Claudio Suarez
2021-10-15 19:24       ` [Intel-gfx] " Claudio Suarez
2021-10-15 19:24       ` [Nouveau] " Claudio Suarez
2021-10-15 19:33       ` Ville Syrjälä
2021-10-15 19:33         ` [Intel-gfx] " Ville Syrjälä
2021-10-15 19:33         ` [Nouveau] " Ville Syrjälä
2021-10-15 19:46         ` [Intel-gfx] " Ville Syrjälä
2021-10-15 19:46           ` [Nouveau] " Ville Syrjälä
2021-10-16  8:25         ` [Freedreno] " Claudio Suarez
2021-10-16  8:25           ` [Intel-gfx] " Claudio Suarez
2021-10-16  8:25           ` [Nouveau] " Claudio Suarez
2021-10-16  8:58           ` Claudio Suarez
2021-10-16  8:58             ` [Intel-gfx] " Claudio Suarez
2021-10-16  8:58             ` [Nouveau] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 02/15] drm/amdgpu: use drm_* functions instead of duplicated code in amdgpu driver Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 15:14   ` Harry Wentland
2021-10-15 15:14     ` [Intel-gfx] " Harry Wentland
2021-10-15 15:14     ` [Nouveau] " Harry Wentland
2021-10-16 10:15     ` Claudio Suarez
2021-10-16 10:15       ` [Intel-gfx] " Claudio Suarez
2021-10-16 10:15       ` [Nouveau] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 03/15] drm/vc4: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 04/15] drm/radeon: " Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 05/15] drm/tegra: " Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 06/15] drm/gma500: " Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 07/15] drm/exynos: " Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 08/15] drm/msm: " Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 09/15] drm/sun4i: " Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 10/15] drm/sti: " Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 11/15] drm/zte: " Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 12/15] drm/rockchip: " Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 13/15] drm/bridge: " Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 14/15] drm/nouveau: " Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 11:37 ` [PATCH 15/15] drm/i915: " Claudio Suarez
2021-10-15 11:37   ` [Nouveau] " Claudio Suarez
2021-10-15 11:37   ` [Intel-gfx] " Claudio Suarez
2021-10-15 12:30   ` [Nouveau] " Ville Syrjälä
2021-10-15 12:30     ` Ville Syrjälä
2021-10-15 18:18     ` Claudio Suarez
2021-10-15 18:18       ` [Nouveau] " Claudio Suarez
2021-10-15 12:44   ` Jani Nikula
2021-10-15 12:44     ` [Intel-gfx] " Jani Nikula
2021-10-15 12:44     ` [Nouveau] " Jani Nikula
2021-10-15 12:58     ` [Intel-gfx] " Ville Syrjälä
2021-10-15 12:58       ` [Nouveau] " Ville Syrjälä
2021-10-15 15:18       ` Jani Nikula [this message]
2021-10-15 15:18         ` Jani Nikula
2021-10-15 18:44         ` Claudio Suarez
2021-10-15 18:44           ` [Nouveau] " Claudio Suarez
2021-10-15 14:24 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork

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=874k9iuxit.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=benjamin.gaignard@linaro.org \
    --cc=bskeggs@redhat.com \
    --cc=christian.koenig@amd.com \
    --cc=cssk@net-c.es \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emma@anholt.net \
    --cc=freedreno@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jingoohan1@gmail.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mripard@kernel.org \
    --cc=narmstrong@baylibre.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=patrik.r.jakobsson@gmail.com \
    --cc=robdclark@gmail.com \
    --cc=robert.foss@linaro.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=sean@poorly.run \
    --cc=thierry.reding@gmail.com \
    --cc=ville.syrjala@linux.intel.com \
    --cc=wens@csie.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.