All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	Melissa Wen <mwen@igalia.com>
Subject: Re: [PATCH v2 3/4] drm/i915/bios: switch to struct drm_edid and struct drm_edid_product_id
Date: Mon, 15 Apr 2024 15:54:33 +0300	[thread overview]
Message-ID: <87edb63hx2.fsf@intel.com> (raw)
In-Reply-To: <ZhVhf0snHrjPKZEi@intel.com>

On Tue, 09 Apr 2024, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Tue, Apr 09, 2024 at 12:46:11PM +0300, Jani Nikula wrote:
>> To avoid accessing and parsing the raw EDID with drm_edid_raw(), switch
>> to the struct drm_edid based function to extract product id, and use the
>> drm printer function to debug log it.
>> 
>> The underlying assumption is that struct drm_edid_product_id and struct
>> lvds_pnp_id describe identical data, albeit with slightly different
>> member definitions.
>> 
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Acked-by: Melissa Wen <mwen@igalia.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_bios.c | 43 ++++++++++-------------
>>  1 file changed, 18 insertions(+), 25 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
>> index 2abd2d7ceda2..3d89e4b39fed 100644
>> --- a/drivers/gpu/drm/i915/display/intel_bios.c
>> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
>> @@ -600,6 +600,9 @@ get_lvds_pnp_id(const struct bdb_lvds_lfp_data *data,
>>  		const struct bdb_lvds_lfp_data_ptrs *ptrs,
>>  		int index)
>>  {
>> +	/* These two are supposed to have the same layout in memory. */
>> +	BUILD_BUG_ON(sizeof(struct lvds_pnp_id) != sizeof(struct drm_edid_product_id));
>> +
>>  	return (const void *)data + ptrs->ptr[index].panel_pnp_id.offset;
>>  }
>>  
>> @@ -613,19 +616,6 @@ get_lfp_data_tail(const struct bdb_lvds_lfp_data *data,
>>  		return NULL;
>>  }
>>  
>> -static void dump_pnp_id(struct drm_i915_private *i915,
>> -			const struct lvds_pnp_id *pnp_id,
>> -			const char *name)
>> -{
>> -	u16 mfg_name = be16_to_cpu((__force __be16)pnp_id->mfg_name);
>> -	char vend[4];
>> -
>> -	drm_dbg_kms(&i915->drm, "%s PNPID mfg: %s (0x%x), prod: %u, serial: %u, week: %d, year: %d\n",
>> -		    name, drm_edid_decode_mfg_id(mfg_name, vend),
>> -		    pnp_id->mfg_name, pnp_id->product_code, pnp_id->serial,
>> -		    pnp_id->mfg_week, pnp_id->mfg_year + 1990);
>> -}
>> -
>>  static int opregion_get_panel_type(struct drm_i915_private *i915,
>>  				   const struct intel_bios_encoder_data *devdata,
>>  				   const struct drm_edid *drm_edid, bool use_fallback)
>> @@ -664,21 +654,21 @@ static int pnpid_get_panel_type(struct drm_i915_private *i915,
>>  {
>>  	const struct bdb_lvds_lfp_data *data;
>>  	const struct bdb_lvds_lfp_data_ptrs *ptrs;
>> -	const struct lvds_pnp_id *edid_id;
>> -	struct lvds_pnp_id edid_id_nodate;
>> -	const struct edid *edid = drm_edid_raw(drm_edid); /* FIXME */
>> +	struct drm_edid_product_id product_id, product_id_nodate;
>> +	struct drm_printer p;
>>  	int i, best = -1;
>>  
>> -	if (!edid)
>> +	if (!drm_edid)
>>  		return -1;
>>  
>> -	edid_id = (const void *)&edid->mfg_id[0];
>> +	drm_edid_get_product_id(drm_edid, &product_id);
>
> I don't really like s/edid_id/product_id/ rename.
> The variable names were trying to convey the source of
> the data (EDID vs. VBT).
>
> But not a huge deal wither way. Series is
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Thanks, pushed the lot to drm-misc-next.

BR,
Jani.


-- 
Jani Nikula, Intel

  reply	other threads:[~2024-04-15 12:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09  9:46 [PATCH v2 0/4] drm/edid & drm/i915: vendor and product id logging improvements Jani Nikula
2024-04-09  9:46 ` [PATCH v2 1/4] drm/edid: add drm_edid_get_product_id() Jani Nikula
2024-04-09  9:46 ` [PATCH v2 2/4] drm/edid: add drm_edid_print_product_id() Jani Nikula
2024-04-09  9:46 ` [PATCH v2 3/4] drm/i915/bios: switch to struct drm_edid and struct drm_edid_product_id Jani Nikula
2024-04-09 15:40   ` Ville Syrjälä
2024-04-15 12:54     ` Jani Nikula [this message]
2024-04-09  9:46 ` [PATCH v2 4/4] drm/i915/bios: return drm_edid_product_id from get_lvds_pnp_id() Jani Nikula
2024-04-09 14:16 ` ✗ Fi.CI.SPARSE: warning for drm/edid & drm/i915: vendor and product id logging improvements (rev2) Patchwork
2024-04-09 14:28 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-04-10  7:42 ` ✗ Fi.CI.SPARSE: warning for drm/edid & drm/i915: vendor and product id logging improvements (rev3) Patchwork
2024-04-10  8:01 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-04-10 10:08   ` Jani Nikula
2024-04-11  7:59     ` Illipilli, TejasreeX
2024-04-11  7:58 ` ✓ Fi.CI.BAT: success " Patchwork
2024-04-11 18:53 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-04-12  8:06   ` Jani Nikula
2024-04-16  1:13     ` Rodrigo Vivi

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=87edb63hx2.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mwen@igalia.com \
    --cc=ville.syrjala@linux.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 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.