All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sharma, Shashank" <shashank.sharma@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 16/20] drm: add function to read vendor OUI
Date: Thu, 13 Jul 2017 18:20:03 +0530	[thread overview]
Message-ID: <db668de9-d5ef-a811-e737-aa2802eef0b0@intel.com> (raw)
In-Reply-To: <20170713123709.GW12629@intel.com>

Regards

Shashank


On 7/13/2017 6:07 PM, Ville Syrjälä wrote:
> On Thu, Jul 13, 2017 at 10:34:26AM +0530, Sharma, Shashank wrote:
>> Regads
>>
>> Shashank
>>
>>
>> On 7/12/2017 10:45 PM, Ville Syrjälä wrote:
>>> On Mon, Jul 10, 2017 at 04:48:44PM +0530, Shashank Sharma wrote:
>>>> This patch adds a helper function in DP dual mode layer to
>>>> read the vendor's IEEE OUI signature from a Dual mode adapter.
>>>> This will be used to differentiate between different LSPCON
>>>> vendors, to address their custom programming requirements.
>>> Can't we just read it from DPCD instead?
>> You are right, as we have DPCD cached, we can do it from DPCD too, and
>> in fact that was my first implementation.
>> But then I thought what if some driver doesn't cache DPCD, so thought it
>> would be good to have a helper function
>> to check this out.
>> If you think DPCD would be a better idea, I need not to touch DRM layer
>> at all, and this will be only I915 implementation.
> Yeah, less code seems like a good thing. I think we might even have that
> OUI stuff already read out and cached for other purposes.
Sure, then, I will extract OUI and cache it in a variable.
- Shashank
>> - Shashank
>>>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>> Cc: Imre Deak <imre.deak@intel.com>
>>>> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
>>>> ---
>>>>    drivers/gpu/drm/drm_dp_dual_mode_helper.c | 24 ++++++++++++++++++++++++
>>>>    include/drm/drm_dp_dual_mode_helper.h     |  4 +++-
>>>>    2 files changed, 27 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/drm_dp_dual_mode_helper.c b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
>>>> index 80e62f6..0b890dc 100644
>>>> --- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
>>>> +++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
>>>> @@ -396,6 +396,30 @@ const char *drm_dp_get_dual_mode_type_name(enum drm_dp_dual_mode_type type)
>>>>    EXPORT_SYMBOL(drm_dp_get_dual_mode_type_name);
>>>>    
>>>>    /**
>>>> + * drm_lspcon_get_vendor_oui: match vendor OUI signature
>>>> + * @adapter: i2c adapter under action
>>>> + * @vendor_id = 3 bytes of vendor OUI signature, LSB=lower byte
>>>> + *
>>>> + * Returns:
>>>> + * Vendor OUI id if got one, 0 if not
>>>> + */
>>>> +uint32_t drm_lspcon_get_vendor_oui(struct i2c_adapter *adapter)
>>>> +{
>>>> +	uint8_t sign[3] = {0, };
>>>> +	uint32_t oui = 0;
>>>> +
>>>> +	if (drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_LSPCON_OUI_OFFSET,
>>>> +						sign, 3)) {
>>>> +		DRM_ERROR("Can't identify vendor sign\n");
>>>> +		return 0;
>>>> +	}
>>>> +
>>>> +	oui = (sign[0] << 16) | (sign[1] << 8) | sign[2];
>>>> +	return oui;
>>>> +}
>>>> +EXPORT_SYMBOL(drm_lspcon_get_vendor_oui);
>>>> +
>>>> +/**
>>>>     * drm_lspcon_get_mode: Get LSPCON's current mode of operation by
>>>>     * reading offset (0x80, 0x41)
>>>>     * @adapter: I2C-over-aux adapter
>>>> diff --git a/include/drm/drm_dp_dual_mode_helper.h b/include/drm/drm_dp_dual_mode_helper.h
>>>> index 4c42db8..f81b526 100644
>>>> --- a/include/drm/drm_dp_dual_mode_helper.h
>>>> +++ b/include/drm/drm_dp_dual_mode_helper.h
>>>> @@ -60,7 +60,8 @@
>>>>    /* LSPCON specific registers, defined by MCA */
>>>>    #define DP_DUAL_MODE_LSPCON_MODE_CHANGE		0x40
>>>>    #define DP_DUAL_MODE_LSPCON_CURRENT_MODE		0x41
>>>> -#define  DP_DUAL_MODE_LSPCON_MODE_PCON			0x1
>>>> +#define DP_DUAL_MODE_LSPCON_MODE_PCON			0x1
>>>> +#define DP_DUAL_MODE_LSPCON_OUI_OFFSET			0x11
>>>>    
>>>>    struct i2c_adapter;
>>>>    
>>>> @@ -116,4 +117,5 @@ int drm_lspcon_get_mode(struct i2c_adapter *adapter,
>>>>    			enum drm_lspcon_mode *current_mode);
>>>>    int drm_lspcon_set_mode(struct i2c_adapter *adapter,
>>>>    			enum drm_lspcon_mode reqd_mode);
>>>> +uint32_t drm_lspcon_get_vendor_oui(struct i2c_adapter *adapter);
>>>>    #endif
>>>> -- 
>>>> 2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-07-13 12:50 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 11:18 [PATCH 00/20] YCBCR 4:2:0 handling for LSPCON Shashank Sharma
2017-07-10 11:18 ` [PATCH 01/20] drm: handle HDMI 2.0 VICs in AVI info-frames Shashank Sharma
2017-07-10 11:18 ` [PATCH 02/20] drm/edid: complete CEA modedb(VIC 1-107) Shashank Sharma
2017-07-12 17:18   ` Ville Syrjälä
2017-07-13  5:38     ` Sharma, Shashank
2017-07-10 11:18 ` [PATCH 03/20] drm/edid: parse sink information before CEA blocks Shashank Sharma
2017-07-10 11:18 ` [PATCH 04/20] drm/edid: cleanup patch for CEA extended-tag macro Shashank Sharma
2017-07-10 11:18 ` [PATCH 05/20] drm/edid: parse YCBCR420 videomodes from EDID Shashank Sharma
2017-07-10 11:18 ` [PATCH 06/20] drm: add helper to validate YCBCR420 modes Shashank Sharma
2017-07-12 17:18   ` Ville Syrjälä
2017-07-13  5:32     ` Sharma, Shashank
2017-07-13 12:31       ` Ville Syrjälä
2017-07-13 12:42         ` Sharma, Shashank
2017-07-13 13:00           ` Ville Syrjälä
2017-07-13 13:12             ` Sharma, Shashank
2017-07-10 11:18 ` [PATCH 07/20] drm/edid: parse ycbcr 420 deep color information Shashank Sharma
2017-07-12 17:18   ` Ville Syrjälä
2017-07-13  5:33     ` Sharma, Shashank
2017-07-10 11:18 ` [PATCH 08/20] drm: set output colorspace in AVI infoframe Shashank Sharma
2017-07-12 17:17   ` Ville Syrjälä
2017-07-13  5:07     ` Sharma, Shashank
2017-07-13 12:35       ` Ville Syrjälä
2017-07-13 12:49         ` Sharma, Shashank
2017-07-13 13:03           ` Ville Syrjälä
2017-07-13 13:15             ` Sharma, Shashank
2017-07-10 11:18 ` [PATCH 09/20] drm: add helper functions for YCBCR420 handling Shashank Sharma
2017-07-12 17:17   ` Ville Syrjälä
2017-07-13  5:27     ` Sharma, Shashank
2017-07-10 11:18 ` [PATCH 10/20] drm/i915: add config function for YCBCR420 outputs Shashank Sharma
2017-07-12 17:17   ` Ville Syrjälä
2017-07-13  5:26     ` Sharma, Shashank
2017-07-13 12:53       ` Ville Syrjälä
2017-07-13 13:01         ` Sharma, Shashank
2017-07-13 13:26           ` Ville Syrjälä
2017-07-13 13:35             ` Sharma, Shashank
2017-07-13 14:10               ` Ville Syrjälä
2017-07-13 14:17                 ` Sharma, Shashank
2017-07-10 11:18 ` [PATCH 11/20] drm/i915: prepare scaler for YCBCR420 modeset Shashank Sharma
2017-07-12 17:17   ` Ville Syrjälä
2017-07-13  5:21     ` Sharma, Shashank
2017-07-13 12:52       ` [Intel-gfx] " Ville Syrjälä
2017-07-13 12:57         ` Sharma, Shashank
2017-07-13 13:05           ` Ville Syrjälä
2017-07-10 11:18 ` [PATCH 12/20] drm/i915: prepare pipe for YCBCR420 output Shashank Sharma
2017-07-10 11:18 ` [PATCH 13/20] drm/i915: prepare csc unit " Shashank Sharma
2017-07-12 17:17   ` Ville Syrjälä
2017-07-13  5:14     ` Sharma, Shashank
2017-07-13 12:50       ` Ville Syrjälä
2017-07-13 12:53         ` Sharma, Shashank
2017-07-10 11:18 ` [PATCH 14/20] drm/i915: set colorspace for YCBCR420 outputs Shashank Sharma
2017-07-10 11:18 ` [PATCH 15/20] drm/i915/glk: set HDMI 2.0 identifier Shashank Sharma
2017-07-10 11:18 ` [PATCH 16/20] drm: add function to read vendor OUI Shashank Sharma
2017-07-12 17:15   ` Ville Syrjälä
2017-07-13  5:04     ` Sharma, Shashank
2017-07-13 12:37       ` Ville Syrjälä
2017-07-13 12:50         ` Sharma, Shashank [this message]
2017-07-10 11:18 ` [PATCH 17/20] drm/i915: check LSPCON " Shashank Sharma
2017-07-10 11:18 ` [PATCH 18/20] drm/i915: YCBCR 420 support for LSPCON Shashank Sharma
2017-07-12 17:15   ` Ville Syrjälä
2017-07-13  5:02     ` Sharma, Shashank
2017-07-13 13:13       ` Ville Syrjälä
2017-07-13 13:17         ` Sharma, Shashank
2017-07-10 11:18 ` [PATCH 19/20] drm/i915: Move AVI infoframe function to DDI layer Shashank Sharma
2017-07-12 17:15   ` Ville Syrjälä
2017-07-13  4:58     ` Sharma, Shashank
2017-07-13 13:10       ` Ville Syrjälä
2017-07-10 11:18 ` [PATCH 20/20] drm/i915: write AVI infoframes for LSPCON Shashank Sharma
2017-07-12 17:24   ` Ville Syrjälä
2017-07-13  5:41     ` Sharma, Shashank
2017-07-13 12:27       ` Ville Syrjälä
2017-07-13 12:39         ` Sharma, Shashank
2017-07-13 12:55           ` Ville Syrjälä
2017-07-13 13:10             ` Sharma, Shashank
2017-07-13 13:19               ` Ville Syrjälä
2017-07-13 13:21                 ` Sharma, Shashank
2017-07-10 11:38 ` ✓ Fi.CI.BAT: success for YCBCR 4:2:0 handling " Patchwork

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=db668de9-d5ef-a811-e737-aa2802eef0b0@intel.com \
    --to=shashank.sharma@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --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.