[PATCH 2/3] drm/edid: Check for user aspect ratio input

2014-05-23 Thread Vandana Kannan
On May-22-2014 5:12 PM, Thierry Reding wrote:
> On Thu, May 22, 2014 at 04:50:49PM +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.
>>
>> Signed-off-by: Vandana Kannan 
>> Cc: dri-devel at lists.freedesktop.org
>> ---
>>  drivers/gpu/drm/drm_edid.c | 9 +++--
>>  1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 7a4fd2e..05db619 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -3657,8 +3657,13 @@ 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 CEA mode list or
>> + *  user input
>> +*/
> 
> This comment is mangled, it should look like this:
> 
>   /*
>* Populate...
>*/
> 
> And perhaps to clarify that user input takes precedence over CEA you
> could list it first in the comment, like so for example:
> 
>   /*
>* Populate picture aspect ratio from either user input (if specified)
>* or from the CEA mode.
>*/
>
Sure, I will modify this comment

> Also can you please resend patch 3/3 to dri-devel at lists.freedesktop.org
> as well so we can see how this is used in a driver?
> 
> Thierry
> 
I have resent this patch including dri-devel at lists.freedesktop.org

Thanks,
Vandana


[PATCH 2/3] drm/edid: Check for user aspect ratio input

2014-05-22 Thread Vandana Kannan
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.

Signed-off-by: Vandana Kannan 
Cc: dri-devel at lists.freedesktop.org
---
 drivers/gpu/drm/drm_edid.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 7a4fd2e..05db619 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3657,8 +3657,13 @@ 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 CEA mode list or
+*  user input
+   */
+   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);

-- 
1.9.3



[PATCH 2/3] drm/edid: Check for user aspect ratio input

2014-05-22 Thread Thierry Reding
On Thu, May 22, 2014 at 04:50:49PM +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.
> 
> Signed-off-by: Vandana Kannan 
> Cc: dri-devel at lists.freedesktop.org
> ---
>  drivers/gpu/drm/drm_edid.c | 9 +++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 7a4fd2e..05db619 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3657,8 +3657,13 @@ 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 CEA mode list or
> +  *  user input
> + */

This comment is mangled, it should look like this:

/*
 * Populate...
 */

And perhaps to clarify that user input takes precedence over CEA you
could list it first in the comment, like so for example:

/*
 * Populate picture aspect ratio from either user input (if specified)
 * or from the CEA mode.
 */

Also can you please resend patch 3/3 to dri-devel at lists.freedesktop.org
as well so we can see how this is used in a driver?

Thierry
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: 



[PATCH 2/3] drm/edid: Check for user aspect ratio input

2014-04-07 Thread Vandana Kannan
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.

Signed-off-by: Vandana Kannan 
Cc: dri-devel at lists.freedesktop.org
---
 drivers/gpu/drm/drm_edid.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index b8d6c51..62680e7 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3630,8 +3630,13 @@ 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 CEA mode list or
+*  user input
+   */
+   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);

-- 
1.9.1



[PATCH 2/3] drm/edid: Check for user aspect ratio input

2014-04-07 Thread Vandana Kannan
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.

Signed-off-by: Vandana Kannan 
Cc: dri-devel at lists.freedesktop.org
---
 drivers/gpu/drm/drm_edid.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index b8d6c51..62680e7 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3630,8 +3630,13 @@ 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 CEA mode list or
+*  user input
+   */
+   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);

-- 
1.9.1