All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sharma, Shashank" <shashank.sharma@intel.com>
To: Jose Abreu <Jose.Abreu@synopsys.com>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 06/11] drm: create hdmi output property
Date: Wed, 19 Apr 2017 21:20:42 +0530	[thread overview]
Message-ID: <40ce5abb-6bbe-9911-af9e-cc2eb9f0a9d8@intel.com> (raw)
In-Reply-To: <1c6540d7-d86f-219c-130e-6c54590a2120@synopsys.com>

Hello Jose,

Sorry for delay in response, I was on vacation.
Please find my comments inline.

Regards
Shashank
On 4/12/2017 3:28 PM, Jose Abreu wrote:
> Hi Shashank,
>
>
> On 07-04-2017 17:39, Shashank Sharma wrote:
>> HDMI displays can support various output types, based on
>> the color space and subsampling type. The possible
>> outputs from a HDMI 2.0 monitor could be:
>>   - RGB
>>   - YCBCR 444
>>   - YCBCR 422
>>   - YCBCR 420
>>
>> This patch adds a drm property, using which, a userspace
>> can specify its preference, for the HDMI output type.
>> The output type enums are similar to the mentioned outputs
>> above. To handle various subsampling of YCBCR output types,
>> this property allows two special cases:
>>   - DRM_HDMI_OUTPUT_YCBCR_HQ
>> This indicates preferred output should be YCBCR output, with highest
>> subsampling rate by the source/sink, which can be typically:
>>   - ycbcr444
>>   - ycbcr422
>>   - ycbcr420
>>   - DRM_HDMI_OUTPUT_YCBCR_LQ
>> This indicates preferred output should be YCBCR output, with lowest
>> subsampling rate supported by source/sink, which can be:
>>   - ycbcr420
>>   - ycbcr422
>>   - ycbcr444
>>
>> Default value of the property is set to 0 = RGB, so no changes if you
>> dont set the property.
> The HQ/LQ properties are a nice idea
Courtesy Ville :)
> but where are you parsing
> them (because in patch 07/11 you reject these properties)? Also,
> you need to make sure that source and sink supports the color space.
Yes, and that's why its handling is kept in the core driver. If you see 
my I915 patches, I have parsed and handled the HQ and LQ properties in
intel_hdmi_compute_ycbcr_config function. I am rejecting the HQ/LQ in 
07/11, coz by the time we want to set AVI_IF the driver should have picked
the highest/lowest YCBCR mode, and now we should have a definite one out 
of 444,422 or 420.

Do you think it would be a good idea to find the HQ/LQ YCBCR output in 
DRM layer ? In that case it would be difficult if source supports these 
outputs

- Shashank
> Best regards,
> Jose Miguel Abreu
>
>> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
>> Cc: Jose Abreu <joabreu@synopsys.com>
>> Cc: Daniel Vetter <daniel.vetter@intel.com>
>> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
>> ---
>>   drivers/gpu/drm/drm_atomic.c        |  2 ++
>>   drivers/gpu/drm/drm_atomic_helper.c |  4 ++++
>>   drivers/gpu/drm/drm_connector.c     | 31 +++++++++++++++++++++++++++++++
>>   include/drm/drm_connector.h         | 14 ++++++++++++++
>>   include/drm/drm_mode_config.h       |  5 +++++
>>   5 files changed, 56 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
>> index f32506a..6ef34dc 100644
>> --- a/drivers/gpu/drm/drm_atomic.c
>> +++ b/drivers/gpu/drm/drm_atomic.c
>> @@ -1123,6 +1123,8 @@ int drm_atomic_connector_set_property(struct drm_connector *connector,
>>   		 */
>>   		if (state->link_status != DRM_LINK_STATUS_GOOD)
>>   			state->link_status = val;
>> +	} else if (property == config->hdmi_output_property) {
>> +		state->hdmi_output = val;
>>   	} else if (connector->funcs->atomic_set_property) {
>>   		return connector->funcs->atomic_set_property(connector,
>>   				state, property, val);
>> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
>> index 8be9719..fcba3c0 100644
>> --- a/drivers/gpu/drm/drm_atomic_helper.c
>> +++ b/drivers/gpu/drm/drm_atomic_helper.c
>> @@ -567,6 +567,10 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
>>   			if (old_connector_state->link_status !=
>>   			    new_connector_state->link_status)
>>   				new_crtc_state->connectors_changed = true;
>> +
>> +			if (old_connector_state->hdmi_output !=
>> +			    new_connector_state->hdmi_output)
>> +				new_crtc_state->connectors_changed = true;
>>   		}
>>   
>>   		if (funcs->atomic_check)
>> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
>> index 9f84761..10201b1 100644
>> --- a/drivers/gpu/drm/drm_connector.c
>> +++ b/drivers/gpu/drm/drm_connector.c
>> @@ -227,6 +227,11 @@ int drm_connector_init(struct drm_device *dev,
>>   					      config->edid_property,
>>   					      0);
>>   
>> +	if (connector_type != DRM_MODE_CONNECTOR_VIRTUAL)
>> +		drm_object_attach_property(&connector->base,
>> +					   config->hdmi_output_property,
>> +					   0);
>> +
>>   	drm_object_attach_property(&connector->base,
>>   				      config->dpms_property, 0);
>>   
>> @@ -617,6 +622,25 @@ static const struct drm_prop_enum_list drm_link_status_enum_list[] = {
>>   };
>>   DRM_ENUM_NAME_FN(drm_get_link_status_name, drm_link_status_enum_list)
>>   
>> +static const struct drm_prop_enum_list drm_hdmi_output_enum_list[] = {
>> +	{ DRM_HDMI_OUTPUT_DEFAULT_RGB, "output_rgb" },
>> +	{ DRM_HDMI_OUTPUT_YCBCR422, "output_ycbcr422" },
>> +	{ DRM_HDMI_OUTPUT_YCBCR444, "output_ycbcr444" },
>> +	{ DRM_HDMI_OUTPUT_YCBCR420, "output_ycbcr420" },
>> +	{ DRM_HDMI_OUTPUT_YCBCR_HQ, "output_ycbcr_high_subsampling" },
>> +	{ DRM_HDMI_OUTPUT_YCBCR_LQ, "output_ycbcr_low_subsampling" },
>> +};
>> +
>> +/**
>> + * drm_get_hdmi_output_name - return a string for a given hdmi output enum
>> + * @type: enum of output type
>> + */
>> +const char *drm_get_hdmi_output_name(enum drm_hdmi_output_type type)
>> +{
>> +	return drm_hdmi_output_enum_list[type].name;
>> +}
>> +EXPORT_SYMBOL(drm_get_hdmi_output_name);
>> +
>>   /**
>>    * drm_display_info_set_bus_formats - set the supported bus formats
>>    * @info: display info to store bus formats in
>> @@ -789,6 +813,13 @@ int drm_connector_create_standard_properties(struct drm_device *dev)
>>   		return -ENOMEM;
>>   	dev->mode_config.link_status_property = prop;
>>   
>> +	prop = drm_property_create_enum(dev, 0, "hdmi_output_format",
>> +					drm_hdmi_output_enum_list,
>> +					ARRAY_SIZE(drm_hdmi_output_enum_list));
>> +	if (!prop)
>> +		return -ENOMEM;
>> +	dev->mode_config.hdmi_output_property = prop;
>> +
>>   	return 0;
>>   }
>>   
>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>> index 4545c6e..e872a88 100644
>> --- a/include/drm/drm_connector.h
>> +++ b/include/drm/drm_connector.h
>> @@ -300,6 +300,17 @@ struct drm_tv_connector_state {
>>   	unsigned int hue;
>>   };
>>   
>> +/* HDMI output pixel format */
>> +enum drm_hdmi_output_type {
>> +	DRM_HDMI_OUTPUT_DEFAULT_RGB, /* default RGB */
>> +	DRM_HDMI_OUTPUT_YCBCR422, /* YCBCR 422 */
>> +	DRM_HDMI_OUTPUT_YCBCR444, /* YCBCR 444 */
>> +	DRM_HDMI_OUTPUT_YCBCR420, /* YCBCR 420 */
>> +	DRM_HDMI_OUTPUT_YCBCR_HQ, /* Highest subsampled YUV */
>> +	DRM_HDMI_OUTPUT_YCBCR_LQ, /* Lowest subsampled YUV */
>> +	DRM_HDMI_OUTPUT_INVALID, /* Guess what ? */
>> +};
>> +
>>   /**
>>    * struct drm_connector_state - mutable connector state
>>    * @connector: backpointer to the connector
>> @@ -329,6 +340,8 @@ struct drm_connector_state {
>>   	struct drm_atomic_state *state;
>>   
>>   	struct drm_tv_connector_state tv;
>> +
>> +	enum drm_hdmi_output_type hdmi_output;
>>   };
>>   
>>   /**
>> @@ -945,6 +958,7 @@ static inline void drm_connector_unreference(struct drm_connector *connector)
>>   
>>   const char *drm_get_connector_status_name(enum drm_connector_status status);
>>   const char *drm_get_subpixel_order_name(enum subpixel_order order);
>> +const char *drm_get_hdmi_output_name(enum drm_hdmi_output_type type);
>>   const char *drm_get_dpms_name(int val);
>>   const char *drm_get_dvi_i_subconnector_name(int val);
>>   const char *drm_get_dvi_i_select_name(int val);
>> diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
>> index 4298171..1887261 100644
>> --- a/include/drm/drm_mode_config.h
>> +++ b/include/drm/drm_mode_config.h
>> @@ -740,6 +740,11 @@ struct drm_mode_config {
>>   	 * the position of the output on the host's screen.
>>   	 */
>>   	struct drm_property *suggested_y_property;
>> +	/**
>> +	 * @hdmi_output_property: output pixel format from HDMI display
>> +	 * Default is set for RGB
>> +	 */
>> +	struct drm_property *hdmi_output_property;
>>   
>>   	/* dumb ioctl parameters */
>>   	uint32_t preferred_depth, prefer_shadow;

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-04-19 15:50 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07 16:39 [PATCH 00/11] HDMI YCBCR output handling in DRM layer Shashank Sharma
2017-04-07 16:39 ` [PATCH 01/11] drm: Add HDMI 2.0 VIC support for AVI info-frames Shashank Sharma
2017-04-10  9:47   ` Andrzej Hajda
2017-04-19 16:02     ` Sharma, Shashank
2017-04-07 16:39 ` [PATCH 02/11] drm/edid: Complete CEA modedb(VIC 1-107) Shashank Sharma
2017-05-08 16:22   ` Ville Syrjälä
2017-05-08 16:44     ` Sharma, Shashank
2017-04-07 16:39 ` [PATCH 03/11] drm: parse ycbcr 420 vdb block Shashank Sharma
2017-05-08 16:24   ` Ville Syrjälä
2017-05-08 16:41     ` Sharma, Shashank
2017-05-08 17:09       ` Ville Syrjälä
2017-05-09  8:34         ` Sharma, Shashank
2017-05-09 15:28           ` Ville Syrjälä
2017-05-10  5:01             ` Sharma, Shashank
2017-04-07 16:39 ` [PATCH 04/11] drm: parse ycbcr420 vcb block Shashank Sharma
2017-04-08 15:14   ` kbuild test robot
2017-04-08 17:43   ` Emil Velikov
2017-04-19 16:04     ` Sharma, Shashank
2017-05-08 16:58   ` Ville Syrjälä
2017-05-09  8:19     ` Sharma, Shashank
2017-04-07 16:39 ` [PATCH 05/11] drm: parse ycbcr 420 deep color information Shashank Sharma
2017-04-08 18:29   ` kbuild test robot
2017-04-07 16:39 ` [PATCH 06/11] drm: create hdmi output property Shashank Sharma
2017-04-08 20:53   ` kbuild test robot
2017-04-12  9:58   ` Jose Abreu
2017-04-19 15:50     ` Sharma, Shashank [this message]
2017-04-07 16:39 ` [PATCH 07/11] drm: set output colorspace in AVI infoframe Shashank Sharma
2017-04-12  9:49   ` Jose Abreu
2017-04-19 15:55     ` Sharma, Shashank
2017-04-07 16:39 ` [PATCH 08/11] drm/i915: handle ycbcr outputs Shashank Sharma
2017-04-07 16:39 ` [PATCH 09/11] drm/i915: handle csc for ycbcr HDMI output Shashank Sharma
2017-04-07 16:39 ` [PATCH 10/11] drm/i915: prepare ycbcr420 modeset Shashank Sharma
2017-04-07 16:39 ` [PATCH 11/11] drm/i915: set colorspace for ycbcr outputs Shashank Sharma
2017-04-07 17:41 ` ✓ Fi.CI.BAT: success for HDMI YCBCR output handling in DRM layer 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=40ce5abb-6bbe-9911-af9e-cc2eb9f0a9d8@intel.com \
    --to=shashank.sharma@intel.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.