From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, Matt Roper <matthew.d.roper@intel.com>
Subject: Re: [Intel-gfx] [PATCH 1/3] drm/i915: move more of the display probe to display code
Date: Tue, 12 Sep 2023 08:31:29 -0400 [thread overview]
Message-ID: <ZQBaIWoG50ycOLKq@intel.com> (raw)
In-Reply-To: <20230912120537.2158209-1-jani.nikula@intel.com>
On Tue, Sep 12, 2023 at 03:05:35PM +0300, Jani Nikula wrote:
> Initializing i915->display.info.__device_info and DISPLAY_RUNTIME_INFO()
> really belongs in display code. Move them there.
>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> .../drm/i915/display/intel_display_device.c | 24 ++++++++++++++++---
> .../drm/i915/display/intel_display_device.h | 4 +---
> drivers/gpu/drm/i915/intel_device_info.c | 14 +----------
> 3 files changed, 23 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c
> index c39f8a15d8aa..ed564566e31b 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.c
> @@ -850,9 +850,9 @@ probe_gmdid_display(struct drm_i915_private *i915, u16 *ver, u16 *rel, u16 *step
> return &no_display;
> }
>
> -const struct intel_display_device_info *
> -intel_display_device_probe(struct drm_i915_private *i915, bool has_gmdid,
> - u16 *gmdid_ver, u16 *gmdid_rel, u16 *gmdid_step)
> +static const struct intel_display_device_info *
> +probe_display(struct drm_i915_private *i915, bool has_gmdid,
> + u16 *gmdid_ver, u16 *gmdid_rel, u16 *gmdid_step)
> {
> struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
> int i;
> @@ -876,6 +876,24 @@ intel_display_device_probe(struct drm_i915_private *i915, bool has_gmdid,
> return &no_display;
> }
>
> +void intel_display_device_probe(struct drm_i915_private *i915)
> +{
> + u16 ver, rel, step;
> +
> + /* Probe display support */
> + i915->display.info.__device_info = probe_display(i915, HAS_GMD_ID(i915),
> + &ver, &rel, &step);
> + memcpy(DISPLAY_RUNTIME_INFO(i915),
> + &DISPLAY_INFO(i915)->__runtime_defaults,
> + sizeof(*DISPLAY_RUNTIME_INFO(i915)));
> +
> + if (HAS_GMD_ID(i915)) {
> + DISPLAY_RUNTIME_INFO(i915)->ip.ver = ver;
> + DISPLAY_RUNTIME_INFO(i915)->ip.rel = rel;
> + DISPLAY_RUNTIME_INFO(i915)->ip.step = step;
> + }
> +}
> +
> void intel_display_device_info_runtime_init(struct drm_i915_private *i915)
> {
> struct intel_display_runtime_info *display_runtime = DISPLAY_RUNTIME_INFO(i915);
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h
> index 8198401aa5be..a7b6469b43a6 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.h
> @@ -149,9 +149,7 @@ struct intel_display_device_info {
> } color;
> };
>
> -const struct intel_display_device_info *
> -intel_display_device_probe(struct drm_i915_private *i915, bool has_gmdid,
> - u16 *ver, u16 *rel, u16 *step);
> +void intel_display_device_probe(struct drm_i915_private *i915);
> void intel_display_device_info_runtime_init(struct drm_i915_private *i915);
>
> void intel_display_device_info_print(const struct intel_display_device_info *info,
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
> index 9dfa680a4c62..b9b8b22540cb 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -410,7 +410,6 @@ void intel_device_info_driver_create(struct drm_i915_private *i915,
> const struct intel_device_info *match_info)
> {
> struct intel_runtime_info *runtime;
> - u16 ver, rel, step;
>
> /* Setup INTEL_INFO() */
> i915->__info = match_info;
> @@ -419,18 +418,7 @@ void intel_device_info_driver_create(struct drm_i915_private *i915,
> runtime = RUNTIME_INFO(i915);
> memcpy(runtime, &INTEL_INFO(i915)->__runtime, sizeof(*runtime));
>
> - /* Probe display support */
> - i915->display.info.__device_info = intel_display_device_probe(i915, HAS_GMD_ID(i915),
> - &ver, &rel, &step);
> - memcpy(DISPLAY_RUNTIME_INFO(i915),
> - &DISPLAY_INFO(i915)->__runtime_defaults,
> - sizeof(*DISPLAY_RUNTIME_INFO(i915)));
> -
> - if (HAS_GMD_ID(i915)) {
> - DISPLAY_RUNTIME_INFO(i915)->ip.ver = ver;
> - DISPLAY_RUNTIME_INFO(i915)->ip.rel = rel;
> - DISPLAY_RUNTIME_INFO(i915)->ip.step = step;
> - }
> + intel_display_device_probe(i915);
>
> runtime->device_id = device_id;
> }
> --
> 2.39.2
>
next prev parent reply other threads:[~2023-09-12 12:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-12 12:05 [Intel-gfx] [PATCH 1/3] drm/i915: move more of the display probe to display code Jani Nikula
2023-09-12 12:05 ` [Intel-gfx] [PATCH 2/3] drm/i915/display: call gmdid display probe at a higher level Jani Nikula
2023-09-12 12:31 ` Rodrigo Vivi
2023-09-12 12:05 ` [Intel-gfx] [PATCH 3/3] drm/i915: move intel_display_device_probe() one level higher Jani Nikula
2023-09-12 12:32 ` Rodrigo Vivi
2023-09-12 20:57 ` Matt Roper
2023-09-12 21:35 ` Jani Nikula
2023-09-15 16:39 ` Jani Nikula
2023-09-12 12:31 ` Rodrigo Vivi [this message]
2023-09-15 15:39 ` [Intel-gfx] [PATCH 1/3] drm/i915: move more of the display probe to display code Jani Nikula
2023-09-12 19:46 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/3] " Patchwork
2023-09-12 20:04 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-09-12 23:11 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/3] drm/i915: move more of the display probe to display code (rev2) Patchwork
2023-09-12 23:29 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-09-14 22:46 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/3] drm/i915: move more of the display probe to display code (rev3) Patchwork
2023-09-14 23:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-09-15 6:46 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=ZQBaIWoG50ycOLKq@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=matthew.d.roper@intel.com \
/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