diff mbox series

[v2,09/14] drm/i915: Write HDR infoframe and send to panel

Message ID 1544560702-16447-10-git-send-email-uma.shankar@intel.com (mailing list archive)
State New, archived
Headers show
Series Add HDR Metadata Parsing and handling in DRM layer | expand

Commit Message

Shankar, Uma Dec. 11, 2018, 8:38 p.m. UTC
Enable writing of HDR metadata infoframe to panel.
The data will be provid by usersapace compositors, based
on blending policies and passsed to driver through a blob
property.

v2: Rebase

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
---
 drivers/gpu/drm/i915/intel_hdmi.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

Comments

Sharma, Shashank Dec. 21, 2018, 8:43 a.m. UTC | #1
Regards

Shashank


On 12/12/2018 2:08 AM, Uma Shankar wrote:
> Enable writing of HDR metadata infoframe to panel.
> The data will be provid by usersapace compositors, based
> on blending policies and passsed to driver through a blob
> property.
>
> v2: Rebase
>
> Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_hdmi.c | 27 +++++++++++++++++++++++++++
>   1 file changed, 27 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 8a1e5cb..6286c4a 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -475,6 +475,29 @@ static void intel_write_infoframe(struct intel_encoder *encoder,
>   					frame->any.type, buffer, len);
>   }
>   
> +/* Set Dynamic Range and Mastering Infoframe */
> +static void intel_hdmi_set_drm_infoframe(struct drm_encoder *encoder,
> +					 const struct intel_crtc_state
> +					 *crtc_state,
> +					 const struct drm_connector_state
> +
We will need this function for lspcon too, if you want to add in a 
different series, please add a TODO: here.
> 					 *conn_state)
> +{
> +	union hdmi_infoframe frame;
> +	struct hdr_static_metadata *hdr_metadata;
> +	int ret;
> +
> +	hdr_metadata = (struct hdr_static_metadata *)
> +		conn_state->hdr_source_metadata_blob_ptr->data;
> +
> +	ret = drm_hdmi_infoframe_set_hdr_metadata(&frame.drm, hdr_metadata);
> +	if (ret < 0) {
> +		DRM_ERROR("couldn't set HDR metadata in infoframe\n");
> +		return;
> +	}
> +
> +	intel_write_infoframe(encoder, crtc_state, &frame);
> +}
> +
>   static void intel_hdmi_set_avi_infoframe(struct intel_encoder *encoder,
>   					 const struct intel_crtc_state *crtc_state,
>   					 const struct drm_connector_state *conn_state)
> @@ -883,6 +906,10 @@ static void hsw_set_infoframes(struct intel_encoder *encoder,
>   	intel_hdmi_set_avi_infoframe(encoder, crtc_state, conn_state);
>   	intel_hdmi_set_spd_infoframe(encoder, crtc_state);
>   	intel_hdmi_set_hdmi_infoframe(encoder, crtc_state, conn_state);
> +
> +	/* Set Dynamic Range and Mastering Infoframe if supported and changed */
> +	if (conn_state->hdr_metadata_changed)
> +		intel_hdmi_set_drm_infoframe(encoder, crtc_state, conn_state);
>   }
>   
>   void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable)
- Shashank
Shankar, Uma Jan. 8, 2019, 6:55 a.m. UTC | #2
>-----Original Message-----
>From: Sharma, Shashank
>Sent: Friday, December 21, 2018 2:14 PM
>To: Shankar, Uma <uma.shankar@intel.com>; intel-gfx@lists.freedesktop.org;
>dri-devel@lists.freedesktop.org
>Cc: Lankhorst, Maarten <maarten.lankhorst@intel.com>; Syrjala, Ville
><ville.syrjala@intel.com>; Brian.Starkey@arm.com
>Subject: Re: [v2 09/14] drm/i915: Write HDR infoframe and send to panel
>
>Regards
>
>Shashank
>
>
>On 12/12/2018 2:08 AM, Uma Shankar wrote:
>> Enable writing of HDR metadata infoframe to panel.
>> The data will be provid by usersapace compositors, based on blending
>> policies and passsed to driver through a blob property.
>>
>> v2: Rebase
>>
>> Signed-off-by: Uma Shankar <uma.shankar@intel.com>
>> ---
>>   drivers/gpu/drm/i915/intel_hdmi.c | 27 +++++++++++++++++++++++++++
>>   1 file changed, 27 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c
>> b/drivers/gpu/drm/i915/intel_hdmi.c
>> index 8a1e5cb..6286c4a 100644
>> --- a/drivers/gpu/drm/i915/intel_hdmi.c
>> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
>> @@ -475,6 +475,29 @@ static void intel_write_infoframe(struct intel_encoder
>*encoder,
>>   					frame->any.type, buffer, len);
>>   }
>>
>> +/* Set Dynamic Range and Mastering Infoframe */ static void
>> +intel_hdmi_set_drm_infoframe(struct drm_encoder *encoder,
>> +					 const struct intel_crtc_state
>> +					 *crtc_state,
>> +					 const struct drm_connector_state
>> +
>We will need this function for lspcon too, if you want to add in a different series,
>please add a TODO: here.

Sure, will add the same.

Regards,
Uma Shankar

>> 					 *conn_state)
>> +{
>> +	union hdmi_infoframe frame;
>> +	struct hdr_static_metadata *hdr_metadata;
>> +	int ret;
>> +
>> +	hdr_metadata = (struct hdr_static_metadata *)
>> +		conn_state->hdr_source_metadata_blob_ptr->data;
>> +
>> +	ret = drm_hdmi_infoframe_set_hdr_metadata(&frame.drm,
>hdr_metadata);
>> +	if (ret < 0) {
>> +		DRM_ERROR("couldn't set HDR metadata in infoframe\n");
>> +		return;
>> +	}
>> +
>> +	intel_write_infoframe(encoder, crtc_state, &frame); }
>> +
>>   static void intel_hdmi_set_avi_infoframe(struct intel_encoder *encoder,
>>   					 const struct intel_crtc_state
>*crtc_state,
>>   					 const struct drm_connector_state
>*conn_state) @@ -883,6
>> +906,10 @@ static void hsw_set_infoframes(struct intel_encoder *encoder,
>>   	intel_hdmi_set_avi_infoframe(encoder, crtc_state, conn_state);
>>   	intel_hdmi_set_spd_infoframe(encoder, crtc_state);
>>   	intel_hdmi_set_hdmi_infoframe(encoder, crtc_state, conn_state);
>> +
>> +	/* Set Dynamic Range and Mastering Infoframe if supported and changed
>*/
>> +	if (conn_state->hdr_metadata_changed)
>> +		intel_hdmi_set_drm_infoframe(encoder, crtc_state,
>conn_state);
>>   }
>>
>>   void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi,
>> bool enable)
>- Shashank
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 8a1e5cb..6286c4a 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -475,6 +475,29 @@  static void intel_write_infoframe(struct intel_encoder *encoder,
 					frame->any.type, buffer, len);
 }
 
+/* Set Dynamic Range and Mastering Infoframe */
+static void intel_hdmi_set_drm_infoframe(struct drm_encoder *encoder,
+					 const struct intel_crtc_state
+					 *crtc_state,
+					 const struct drm_connector_state
+					 *conn_state)
+{
+	union hdmi_infoframe frame;
+	struct hdr_static_metadata *hdr_metadata;
+	int ret;
+
+	hdr_metadata = (struct hdr_static_metadata *)
+		conn_state->hdr_source_metadata_blob_ptr->data;
+
+	ret = drm_hdmi_infoframe_set_hdr_metadata(&frame.drm, hdr_metadata);
+	if (ret < 0) {
+		DRM_ERROR("couldn't set HDR metadata in infoframe\n");
+		return;
+	}
+
+	intel_write_infoframe(encoder, crtc_state, &frame);
+}
+
 static void intel_hdmi_set_avi_infoframe(struct intel_encoder *encoder,
 					 const struct intel_crtc_state *crtc_state,
 					 const struct drm_connector_state *conn_state)
@@ -883,6 +906,10 @@  static void hsw_set_infoframes(struct intel_encoder *encoder,
 	intel_hdmi_set_avi_infoframe(encoder, crtc_state, conn_state);
 	intel_hdmi_set_spd_infoframe(encoder, crtc_state);
 	intel_hdmi_set_hdmi_infoframe(encoder, crtc_state, conn_state);
+
+	/* Set Dynamic Range and Mastering Infoframe if supported and changed */
+	if (conn_state->hdr_metadata_changed)
+		intel_hdmi_set_drm_infoframe(encoder, crtc_state, conn_state);
 }
 
 void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable)