From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>,
<intel-xe@lists.freedesktop.org>, <lucas.demarchi@intel.com>
Subject: Re: [PATCH 02/10] drm/i915/display: change probe for no display case
Date: Wed, 22 May 2024 15:57:40 -0400 [thread overview]
Message-ID: <Zk5ONF-268RlkPEn@intel.com> (raw)
In-Reply-To: <8dfac3532a72ca6494c9955987166d9c6e0919bd.1716399081.git.jani.nikula@intel.com>
On Wed, May 22, 2024 at 08:33:39PM +0300, Jani Nikula wrote:
> Return NULL for errors, and handle the no display case in one
> location. This will make subsequent changes easier.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> .../drm/i915/display/intel_display_device.c | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c
> index 9edadc7270f6..03181bb79d21 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.c
> @@ -881,7 +881,7 @@ probe_gmdid_display(struct drm_i915_private *i915, u16 *ver, u16 *rel, u16 *step
> addr = pci_iomap_range(pdev, 0, i915_mmio_reg_offset(GMD_ID_DISPLAY), sizeof(u32));
> if (!addr) {
> drm_err(&i915->drm, "Cannot map MMIO BAR to read display GMD_ID\n");
> - return &no_display;
> + return NULL;
> }
>
> val = ioread32(addr);
> @@ -889,7 +889,7 @@ probe_gmdid_display(struct drm_i915_private *i915, u16 *ver, u16 *rel, u16 *step
>
> if (val == 0) {
> drm_dbg_kms(&i915->drm, "Device doesn't have display\n");
> - return &no_display;
> + return NULL;
> }
>
> *ver = REG_FIELD_GET(GMD_ID_ARCH_MASK, val);
> @@ -903,7 +903,7 @@ probe_gmdid_display(struct drm_i915_private *i915, u16 *ver, u16 *rel, u16 *step
>
> drm_err(&i915->drm, "Unrecognized display IP version %d.%02d; disabling display.\n",
> *ver, *rel);
> - return &no_display;
> + return NULL;
> }
>
> static const struct intel_display_device_info *
> @@ -914,7 +914,7 @@ probe_display(struct drm_i915_private *i915)
>
> if (has_no_display(pdev)) {
> drm_dbg_kms(&i915->drm, "Device doesn't have display\n");
> - return &no_display;
> + return NULL;
> }
>
> for (i = 0; i < ARRAY_SIZE(intel_display_ids); i++) {
> @@ -925,7 +925,7 @@ probe_display(struct drm_i915_private *i915)
> drm_dbg(&i915->drm, "No display ID found for device ID %04x; disabling display.\n",
> pdev->device);
>
> - return &no_display;
> + return NULL;
> }
>
> void intel_display_device_probe(struct drm_i915_private *i915)
> @@ -943,6 +943,9 @@ void intel_display_device_probe(struct drm_i915_private *i915)
> else
> info = probe_display(i915);
>
> + if (!info)
> + goto no_display;
> +
> DISPLAY_INFO(i915) = info;
>
> memcpy(DISPLAY_RUNTIME_INFO(i915),
> @@ -954,6 +957,11 @@ void intel_display_device_probe(struct drm_i915_private *i915)
> DISPLAY_RUNTIME_INFO(i915)->ip.rel = rel;
> DISPLAY_RUNTIME_INFO(i915)->ip.step = step;
> }
> +
> + return;
> +
> +no_display:
> + DISPLAY_INFO(i915) = &no_display;
now I understood why you moved it over and I believe display_runtime_info
is really not needed when no_display, so:
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> }
>
> void intel_display_device_remove(struct drm_i915_private *i915)
> --
> 2.39.2
>
next prev parent reply other threads:[~2024-05-22 19:57 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 17:33 [PATCH 00/10] drm/i915: identify all platforms in display probe Jani Nikula
2024-05-22 17:33 ` [PATCH 01/10] drm/i915/display: move params copy at probe earlier Jani Nikula
2024-05-22 19:53 ` Rodrigo Vivi
2024-05-22 17:33 ` [PATCH 02/10] drm/i915/display: change probe for no display case Jani Nikula
2024-05-22 19:57 ` Rodrigo Vivi [this message]
2024-05-22 17:33 ` [PATCH 03/10] drm/i915/display: check platforms without display one level higher Jani Nikula
2024-05-22 19:58 ` Rodrigo Vivi
2024-05-22 17:33 ` [PATCH 04/10] drm/i915/display: change GMD ID display ip ver propagation at probe Jani Nikula
2024-05-22 20:15 ` Rodrigo Vivi
2024-05-22 17:33 ` [PATCH 05/10] drm/i915/display: add platform descriptors Jani Nikula
2024-05-23 18:47 ` Rodrigo Vivi
2024-05-24 8:17 ` Jani Nikula
2024-05-24 14:04 ` Rodrigo Vivi
2024-05-22 17:33 ` [PATCH 06/10] drm/i915: add LNL PCI IDs Jani Nikula
2024-05-23 18:31 ` Rodrigo Vivi
2024-05-22 17:33 ` [PATCH 07/10] drm/i915/display: change display probe to identify GMD ID based platforms Jani Nikula
2024-05-23 18:39 ` Rodrigo Vivi
2024-05-22 17:33 ` [PATCH 08/10] drm/i915/display: identify platforms with enum and name Jani Nikula
2024-05-23 18:38 ` Rodrigo Vivi
2024-05-22 17:33 ` [PATCH 09/10] drm/i915/display: add support for subplatforms Jani Nikula
2024-05-23 18:37 ` Rodrigo Vivi
2024-05-22 17:33 ` [PATCH 10/10] drm/i915/display: add probe message Jani Nikula
2024-05-23 18:33 ` Rodrigo Vivi
2024-05-22 18:14 ` [PATCH 00/10] drm/i915: identify all platforms in display probe Gustavo Sousa
2024-05-22 18:36 ` Jani Nikula
2024-05-22 19:48 ` Rodrigo Vivi
2024-05-22 18:24 ` ✓ CI.Patch_applied: success for " Patchwork
2024-05-22 18:24 ` ✗ CI.checkpatch: warning " Patchwork
2024-05-22 18:25 ` ✓ CI.KUnit: success " Patchwork
2024-05-22 18:36 ` ✓ CI.Build: " Patchwork
2024-05-22 18:39 ` ✓ CI.Hooks: " Patchwork
2024-05-22 18:40 ` ✗ CI.checksparse: warning " Patchwork
2024-05-22 19:29 ` ✓ CI.BAT: success " Patchwork
2024-05-22 22:42 ` ✗ CI.FULL: failure " Patchwork
2024-05-30 10:13 ` ✓ CI.Patch_applied: success for drm/i915: identify all platforms in display probe (rev2) Patchwork
2024-05-30 10:14 ` ✗ CI.checkpatch: warning " Patchwork
2024-05-30 10:15 ` ✓ CI.KUnit: success " Patchwork
2024-05-30 10:26 ` ✓ CI.Build: " Patchwork
2024-05-30 10:27 ` ✗ CI.Hooks: failure " Patchwork
2024-05-30 10:28 ` ✗ CI.checksparse: warning " Patchwork
2024-05-30 10:52 ` ✓ CI.BAT: success " Patchwork
2024-05-30 12:48 ` ✗ CI.FULL: failure " Patchwork
2024-05-31 8:28 ` [PATCH 00/10] drm/i915: identify all platforms in display probe 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=Zk5ONF-268RlkPEn@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=lucas.demarchi@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;
as well as URLs for NNTP newsgroup(s).