[PATCH v2 2/4] drm/i915: Pass size to spi_oprom_get_vbt

Jani Nikula jani.nikula at linux.intel.com
Tue Feb 27 12:38:32 UTC 2024


On Tue, 20 Feb 2024, Radhakrishna Sripada <radhakrishna.sripada at intel.com> wrote:
> spi_oprom_get_vbt will later be used to show the contents of vbt for
> which the size of vbt is needed.
>
> Cc: Jani Nikula <jani.nikula at intel.com>
> Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada at intel.com>

Yeah, do the same thing in oprom_get_vbt().

Reviewed-by: Jani Nikula <jani.nikula at intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_bios.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index ceb6e4145c62..2624a4528b21 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -2957,7 +2957,8 @@ static u32 intel_spi_read(struct intel_uncore *uncore, u32 offset)
>  	return intel_uncore_read(uncore, PRIMARY_SPI_TRIGGER);
>  }
>  
> -static struct vbt_header *spi_oprom_get_vbt(struct drm_i915_private *i915)
> +static struct vbt_header *spi_oprom_get_vbt(struct drm_i915_private *i915,
> +					    size_t *size)
>  {
>  	u32 count, data, found, store = 0;
>  	u32 static_region, oprom_offset;
> @@ -3000,6 +3001,9 @@ static struct vbt_header *spi_oprom_get_vbt(struct drm_i915_private *i915)
>  
>  	drm_dbg_kms(&i915->drm, "Found valid VBT in SPI flash\n");
>  
> +	if (size)
> +		*size = vbt_size;
> +
>  	return (struct vbt_header *)vbt;
>  
>  err_free_vbt:
> @@ -3103,7 +3107,7 @@ void intel_bios_init(struct drm_i915_private *i915)
>  	 * PCI mapping
>  	 */
>  	if (!vbt && IS_DGFX(i915)) {
> -		oprom_vbt = spi_oprom_get_vbt(i915);
> +		oprom_vbt = spi_oprom_get_vbt(i915, NULL);
>  		vbt = oprom_vbt;
>  	}

-- 
Jani Nikula, Intel


More information about the Intel-gfx mailing list