From: Jani Nikula <jani.nikula@linux.intel.com>
To: Radhakrishna Sripada <radhakrishna.sripada@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 4/4] drm/i915: Show bios vbt when read from firmware/spi/oprom
Date: Tue, 27 Feb 2024 14:43:34 +0200 [thread overview]
Message-ID: <87wmqqhybt.fsf@intel.com> (raw)
In-Reply-To: <20240220223129.3822480-5-radhakrishna.sripada@intel.com>
On Tue, 20 Feb 2024, Radhakrishna Sripada <radhakrishna.sripada@intel.com> wrote:
> Make debugfs vbt only shows valid vbt when read from ACPI opregion.
> Make it work when read from firmware/spi/pci oprom cases.
>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_bios.c | 30 +++++++++++++++++------
> 1 file changed, 23 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index 4cd338ed362d..b9b4ebc0ecd6 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -3723,14 +3723,30 @@ static int intel_bios_vbt_show(struct seq_file *m, void *unused)
> struct drm_i915_private *i915 = m->private;
> const void *vbt;
> size_t vbt_size;
> + bool need_cleanup = false;
>
> - /*
> - * FIXME: VBT might originate from other places than opregion, and then
> - * this would be incorrect.
> - */
> - vbt = intel_opregion_get_vbt(i915, &vbt_size);
> - if (vbt)
> - seq_write(m, vbt, vbt_size);
> + vbt = firmware_get_vbt(i915, &vbt_size);
> +
> + if (!vbt)
> + vbt = intel_opregion_get_vbt(i915, &vbt_size);
> +
> + if (!vbt && IS_DGFX(i915)) {
> + vbt = spi_oprom_get_vbt(i915, &vbt_size);
> + need_cleanup = true;
> + }
> +
> + if (!vbt) {
> + vbt = oprom_get_vbt(i915, &vbt_size);
> + need_cleanup = true;
> + }
We can't duplicate all of that, needs to be a single function that gets
used in both intel_bios_init() and here.
BR,
Jani.
> +
> + if (!vbt)
> + return 0;
> +
> + seq_write(m, vbt, vbt_size);
> +
> + if (need_cleanup)
> + kfree(vbt);
>
> return 0;
> }
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-02-27 12:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-20 22:31 [PATCH v2 0/4] VBT read cleanup Radhakrishna Sripada
2024-02-20 22:31 ` [PATCH v2 1/4] drm/i915: Pass size to oprom_get_vbt Radhakrishna Sripada
2024-02-27 12:37 ` Jani Nikula
2024-02-20 22:31 ` [PATCH v2 2/4] drm/i915: Pass size to spi_oprom_get_vbt Radhakrishna Sripada
2024-02-27 12:38 ` Jani Nikula
2024-02-20 22:31 ` [PATCH v2 3/4] drm/i915: Move vbt read from firmware to intel_bios.c Radhakrishna Sripada
2024-02-27 12:42 ` Jani Nikula
2024-02-20 22:31 ` [PATCH v2 4/4] drm/i915: Show bios vbt when read from firmware/spi/oprom Radhakrishna Sripada
2024-02-27 12:43 ` Jani Nikula [this message]
2024-02-21 2:51 ` ✗ Fi.CI.SPARSE: warning for VBT read cleanup Patchwork
2024-02-21 3:08 ` ✓ Fi.CI.BAT: success " Patchwork
2024-02-21 6:15 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-02-27 12:33 ` [PATCH v2 0/4] " 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=87wmqqhybt.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=radhakrishna.sripada@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).