diff mbox

[v3,2/4] drm/edid: Check for user aspect ratio input

Message ID 1401959729-14406-1-git-send-email-vandana.kannan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

vandana.kannan@intel.com June 5, 2014, 9:15 a.m. UTC
In case user has specified an input for aspect ratio through the property,
then the user space value for PAR would take preference over the value from
CEA mode list.

v2: Thierry's review comments.
	- Modified the comment "Populate..." as per review comments

v3: Thierry's review comments.
	- Modified the comment to block comment format.

Signed-off-by: Vandana Kannan <vandana.kannan@intel.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
---
 drivers/gpu/drm/drm_edid.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Thierry Reding June 5, 2014, 9:25 a.m. UTC | #1
On Thu, Jun 05, 2014 at 02:45:29PM +0530, Vandana Kannan wrote:
> In case user has specified an input for aspect ratio through the property,
> then the user space value for PAR would take preference over the value from
> CEA mode list.
> 
> v2: Thierry's review comments.
> 	- Modified the comment "Populate..." as per review comments
> 
> v3: Thierry's review comments.
> 	- Modified the comment to block comment format.
> 
> Signed-off-by: Vandana Kannan <vandana.kannan@intel.com>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> ---
>  drivers/gpu/drm/drm_edid.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 7a4fd2e..e76c58c 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3657,8 +3657,14 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
>  
>  	frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
>  
> -	/* Populate picture aspect ratio from CEA mode list */
> -	if (frame->video_code > 0)
> +	/*
> +	 * Populate picture aspect ratio from either
> +	 * user input (if specified) or from the CEA mode list.
> +	 */

This still looks slightly odd. Why not use the full available width on
the first line of the comment?

But either way:

Reviewed-by: Thierry Reding <treding@nvidia.com>
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 7a4fd2e..e76c58c 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3657,8 +3657,14 @@  drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
 
 	frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
 
-	/* Populate picture aspect ratio from CEA mode list */
-	if (frame->video_code > 0)
+	/*
+	 * Populate picture aspect ratio from either
+	 * user input (if specified) or from the CEA mode list.
+	 */
+	if (mode->picture_aspect_ratio == HDMI_PICTURE_ASPECT_4_3 ||
+		mode->picture_aspect_ratio == HDMI_PICTURE_ASPECT_16_9)
+		frame->picture_aspect = mode->picture_aspect_ratio;
+	else if (frame->video_code > 0)
 		frame->picture_aspect = drm_get_cea_aspect_ratio(
 						frame->video_code);