All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: Cooper Chiou <cooper.chiou@intel.com>,
	Lee@freedesktop.org, Matt Atwood <matthew.s.atwood@intel.com>,
	Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>,
	"Lee,  Shawn C" <shawn.c.lee@intel.com>
Subject: Re: [PATCH 1/3] drm: Add support for device_id based detection.
Date: Mon, 10 Sep 2018 14:34:29 +0300	[thread overview]
Message-ID: <87o9d537sq.fsf@intel.com> (raw)
In-Reply-To: <1536568214-6949-2-git-send-email-shawn.c.lee@intel.com>

On Mon, 10 Sep 2018, "Lee, Shawn C" <shawn.c.lee@intel.com> wrote:
> DP quirk list just compare sink or branch device's OUI so far.
> That means particular vendor's products will be applied specific
> change. This change would confirm device_id the same or not.
> Then driver can implement some changes for branch/sink device
> that really need additional WA.
>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Cooper Chiou <cooper.chiou@intel.com>
> Cc: Matt Atwood <matthew.s.atwood@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Cc: Clint Taylor <clinton.a.taylor@intel.com>
> Signed-off-by: Lee, Shawn C <shawn.c.lee@intel.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index 0cccbcb2d03e..22753928af41 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -1256,15 +1256,20 @@ EXPORT_SYMBOL(drm_dp_stop_crc);
>  
>  struct dpcd_quirk {
>  	u8 oui[3];
> +	u8 device_id[6];
>  	bool is_branch;
>  	u32 quirks;
>  };
>  
>  #define OUI(first, second, third) { (first), (second), (third) }
> +#define DEVICE_ID(first, second, third, fourth, fifth, sixth) \
> +	{ (first), (second), (third), (fourth), (fifth), (sixth) }
> +
> +#define DEVICE_ID_ANY	DEVICE_ID(0, 0, 0, 0, 0, 0)
>  
>  static const struct dpcd_quirk dpcd_quirk_list[] = {
>  	/* Analogix 7737 needs reduced M and N at HBR2 link rates */
> -	{ OUI(0x00, 0x22, 0xb9), true, BIT(DP_DPCD_QUIRK_LIMITED_M_N) },
> +	{ OUI(0x00, 0x22, 0xb9), DEVICE_ID_ANY, true, BIT(DP_DPCD_QUIRK_LIMITED_M_N) },
>  };
>  
>  #undef OUI
> @@ -1283,6 +1288,7 @@ drm_dp_get_quirks(const struct drm_dp_dpcd_ident *ident, bool is_branch)
>  	const struct dpcd_quirk *quirk;
>  	u32 quirks = 0;
>  	int i;
> +	u8 any_device[6] = DEVICE_ID_ANY;

Please make that any_device[] without the size.

>  
>  	for (i = 0; i < ARRAY_SIZE(dpcd_quirk_list); i++) {
>  		quirk = &dpcd_quirk_list[i];
> @@ -1293,12 +1299,19 @@ drm_dp_get_quirks(const struct drm_dp_dpcd_ident *ident, bool is_branch)
>  		if (memcmp(quirk->oui, ident->oui, sizeof(ident->oui)) != 0)
>  			continue;
>  
> +		if (memcmp(quirk->device_id, any_device, 6) != 0 &&
> +		    memcmp(quirk->device_id, ident->device_id, 6) != 0)

Please use sizeof instead of hard coded 6.

With those changes,

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



> +			continue;
> +
>  		quirks |= quirk->quirks;
>  	}
>  
>  	return quirks;
>  }
>  
> +#undef DEVICE_ID_ANY
> +#undef DEVICE_ID
> +
>  /**
>   * drm_dp_read_desc - read sink/branch descriptor from DPCD
>   * @aux: DisplayPort AUX channel

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-09-10 11:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-10  8:30 [PATCH 0/3] add LG panel to dpcd quirk database Lee, Shawn C
2018-09-10  8:30 ` [PATCH 1/3] drm: Add support for device_id based detection Lee, Shawn C
2018-09-10 11:34   ` Jani Nikula [this message]
2018-09-10  8:30 ` [PATCH 2/3] drm: Change limited M/N quirk to constant N quirk Lee, Shawn C
2018-09-10 11:42   ` Jani Nikula
2018-09-10  8:30 ` [PATCH 3/3] drm: add LG eDP panel to quirk database Lee, Shawn C
2018-09-10 11:43   ` Jani Nikula
2018-09-12  0:34     ` Dhinakaran Pandiyan
2018-09-10  9:29 ` ✗ Fi.CI.BAT: failure for add LG panel to dpcd " Patchwork
2018-09-10 15:26 ` [PATCH v2 0/3] " Lee, Shawn C
2018-09-10 15:26   ` [PATCH v2 1/3] drm: Add support for device_id based detection Lee, Shawn C
2018-09-12  0:12     ` Dhinakaran Pandiyan
2018-09-12  5:37       ` Lee, Shawn C
2018-09-10 15:26   ` [PATCH v2 2/3] drm: Change limited M/N quirk to constant N quirk Lee, Shawn C
2018-09-10 15:26   ` [PATCH v2 3/3] drm: add LG eDP panel to quirk database Lee, Shawn C
2018-09-10 21:48   ` [PATCH v2 0/3] add LG panel to dpcd " Alex Deucher
2018-09-11  2:52     ` Lee, Shawn C
2018-09-11  8:56 ` [PATCH v3 " Lee, Shawn C
2018-09-11  8:56   ` [PATCH v3 1/3] drm: Add support for device_id based detection Lee, Shawn C
2018-09-11  8:56   ` [PATCH v3 2/3] drm: Change limited M/N quirk to constant N quirk Lee, Shawn C
2018-09-11  8:56   ` [PATCH v3 3/3] drm: add LG eDP panel to quirk database Lee, Shawn C
2018-09-11 16:56   ` [PATCH v3 0/3] add LG panel to dpcd " Jani Nikula
2018-09-12  5:25     ` Lee, Shawn C
2018-09-11 23:19   ` Clint Taylor
2018-09-12  9:06     ` 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=87o9d537sq.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=Lee@freedesktop.org \
    --cc=cooper.chiou@intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.s.atwood@intel.com \
    --cc=shawn.c.lee@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.