dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Abreu <Jose.Abreu@synopsys.com>
To: Shashank Sharma <shashank.sharma@intel.com>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: Jose Abreu <Jose.Abreu@synopsys.com>
Subject: Re: [PATCH 07/11] drm: set output colorspace in AVI infoframe
Date: Wed, 12 Apr 2017 10:49:09 +0100	[thread overview]
Message-ID: <34419f5f-6550-0c5e-e9f1-79b5e65666cb@synopsys.com> (raw)
In-Reply-To: <1491583168-20042-8-git-send-email-shashank.sharma@intel.com>

Hi Shashank,


On 07-04-2017 17:39, Shashank Sharma wrote:
> HDMI source must set output colorspace information in AVI
> infoframes, so that the sink can decode upcoming frames
> accordingly.
>
> As this patch series is adding support for HDMI output modes
> other than RGB, this patch adds a function in DRM layer, to
> add the output colorspace information in the AVI infoframes.
>
> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> Cc: Jose Abreu <Jose.Abreu@synopsys.com>
> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
> ---
>  drivers/gpu/drm/drm_edid.c | 40 ++++++++++++++++++++++++++++++++++++++++
>  include/drm/drm_edid.h     |  5 +++++
>  2 files changed, 45 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 828b781..a02d35b 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -4734,6 +4734,46 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
>  EXPORT_SYMBOL(drm_hdmi_avi_infoframe_from_display_mode);
>  
>  /**
> + * drm_hdmi_avi_infoframe_set_colorspace() - fill an HDMI AVI infoframe with
> + * colorspace data of the output type
> + *
> + * @frame: HDMI AVI infoframe
> + * @mode: DRM display mode
> + * @hdmi_output: HDMI output colorspace
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int
> +drm_hdmi_avi_infoframe_set_colorspace(struct hdmi_avi_infoframe *frame,
> +					 const struct drm_display_mode *mode,
> +					 enum drm_hdmi_output_type hdmi_output)
> +{
> +	switch (hdmi_output) {
> +	case DRM_HDMI_OUTPUT_YCBCR444:
> +		frame->colorspace = HDMI_COLORSPACE_YUV444;
> +		break;
> +	case DRM_HDMI_OUTPUT_YCBCR422:
> +		frame->colorspace = HDMI_COLORSPACE_YUV422;
> +		break;
> +	case DRM_HDMI_OUTPUT_YCBCR420:
> +		frame->colorspace = HDMI_COLORSPACE_YUV420;
> +		frame->pixel_repeat = 0;

Why only 4:2:0 is set with pixel repetition off? Is this per spec?

> +		break;
> +	case DRM_HDMI_OUTPUT_DEFAULT_RGB:
> +		frame->colorspace = HDMI_COLORSPACE_RGB;
> +		break;
> +	case DRM_HDMI_OUTPUT_YCBCR_HQ:
> +	case DRM_HDMI_OUTPUT_YCBCR_LQ:
> +	case DRM_HDMI_OUTPUT_INVALID:

Maybe default to RGB here? I don't know if spec says anything
about sending empty colorspace field.

Best regards,
Jose Miguel Abreu

> +		DRM_ERROR("Invalid HDMI output type\n");
> +		return -EINVAL;
> +	}
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL(drm_hdmi_avi_infoframe_set_colorspace);
> +
> +/**
>   * drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe
>   *                                        quantization range information
>   * @frame: HDMI AVI infoframe
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index a4d174e7..8980366 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -329,6 +329,7 @@ struct cea_sad {
>  struct drm_encoder;
>  struct drm_connector;
>  struct drm_display_mode;
> +enum drm_hdmi_output_type;
>  
>  void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid);
>  int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads);
> @@ -351,6 +352,10 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
>  					 const struct drm_display_mode *mode,
>  					 bool is_hdmi2);
>  int
> +drm_hdmi_avi_infoframe_set_colorspace(struct hdmi_avi_infoframe *frame,
> +					 const struct drm_display_mode *mode,
> +					 enum drm_hdmi_output_type hdmi_output);
> +int
>  drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
>  					    const struct drm_display_mode *mode);
>  void

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

  reply	other threads:[~2017-04-12  9:49 UTC|newest]

Thread overview: 33+ 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
2017-04-07 16:39 ` [PATCH 07/11] drm: set output colorspace in AVI infoframe Shashank Sharma
2017-04-12  9:49   ` Jose Abreu [this message]
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

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=34419f5f-6550-0c5e-e9f1-79b5e65666cb@synopsys.com \
    --to=jose.abreu@synopsys.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=shashank.sharma@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox