[PATCH] drm: expand cea861 mode timing table

2016-09-02 Thread Alex Deucher
On Thu, May 26, 2016 at 3:53 AM, Daniel Vetter  wrote:
> On Wed, May 25, 2016 at 07:55:23PM +, Yang, Eric wrote:
>> Hi Thierry Reding,
>>
>> enum hdmi_picture_aspect {
>> >   HDMI_PICTURE_ASPECT_NONE,
>> >   HDMI_PICTURE_ASPECT_4_3,
>> >   HDMI_PICTURE_ASPECT_16_9,
>> > + HDMI_PICTURE_ASPECT_64_27,
>> > + HDMI_PICTURE_ASPECT_256_135,
>> >   HDMI_PICTURE_ASPECT_RESERVED,
>> >  };
>>
>> These are defined since CEA861F defines them in section 4.1.
>> However, it is not indicated in AVI InfoFrame definition for picture aspect 
>> ratio (M1,M0), and we should indicate (M1,M0) = (0,0) for "No Data" when 
>> sending VICs corresponding to these new aspect ratios.
>>
>> If (M1,M0) = (0,0) "No Data" is indicated, then If M=0 (M1=0, M0=0) and 
>> VIC=0, a Sink shall assume the Picture is formatted according to the 
>> Preferred Picture Aspect Ratio.
>>
>> The defition:
>>
>> Preferred Picture Aspect Ratio-In a Dual-Aspect Ratio DTV, the preferred 
>> aspect ratio of a given Video Format Timing (e.g., 720x480p) is the aspect 
>> ratio of the first such timing listed in the EDID data structure (see 
>> Section 4.1). This would be the Picture Aspect Ratio that would be displayed 
>> if a DTV were to receive a Video Format Timing with no accompanying Picture 
>> Aspect Ratio information (i.e., no AVI sent from Source).
>>
>> Alternatively, since our code does not actively use 
>> HDMI_PICTURE_ASPECT_64_27, HDMI_PICTURE_ASPECT_256_135, we can unify them as 
>> HDMI_PICTURE_ASPECT_NONE, and send (M1,M0) = (0,0) to avoid confusion.
>
> There's already drm core patches to add all this stuff for the new aspect
> ratios:
>
> https://patchwork.freedesktop.org/series/4896/

Patches 1-4 from that series are:
Reviewed-by: Alex Deucher 

>
> Would be great if you can review them. Patch 5 of that series (for
> i915.ko) needs to be polished a bit, but the other bits all look fine to
> me at a quick glance.
>
> Thanks, Daniel
>
>>
>>
>>
>> -Original Message-
>> From: Thierry Reding 
>> Sent: Friday, May 13, 2016 11:28:39 AM
>> To: Yang, Eric
>> Cc: dri-devel at lists.freedesktop.org; linux-fbdev at vger.kernel.org; 
>> tomi.valkeinen at ti.com; plagnioj at jcrosoft.com
>> Subject: Re: [PATCH] drm: expand cea861 mode timing table
>>
>> On Thu, May 12, 2016 at 03:37:33PM -0400, Eric Yang wrote:
>> [...]
>> > diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h index
>> > e974420..edbb4fc 100644
>> > --- a/include/linux/hdmi.h
>> > +++ b/include/linux/hdmi.h
>> > @@ -78,6 +78,8 @@ enum hdmi_picture_aspect {
>> >   HDMI_PICTURE_ASPECT_NONE,
>> >   HDMI_PICTURE_ASPECT_4_3,
>> >   HDMI_PICTURE_ASPECT_16_9,
>> > + HDMI_PICTURE_ASPECT_64_27,
>> > + HDMI_PICTURE_ASPECT_256_135,
>> >   HDMI_PICTURE_ASPECT_RESERVED,
>> >  };
>>
>> Where did you get these from? I'm asking because I sent this patch last year 
>> (or at least I wrote it and we discussed it on IRC, since I can't find an 
>> email archive link to it), and back at the time the picture aspect ratio was 
>> the big question mark. My recollection is that CEA-861-F introduces these 
>> new picture aspect ratios in the mode tables but never specifies their 
>> values. As a matter of fact, the AVI infoframe where these values are used 
>> only has space for 4 values (none, 4:3, 16:9 and reserved).
>>
>> Would you mind pointing me at the specification for these values?
>>
>> Thanks,
>> Thierry
>> ___
>> dri-devel mailing list
>> dri-devel at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm: expand cea861 mode timing table

2016-09-02 Thread Emil Velikov
On 1 September 2016 at 20:03, Harry Wentland  wrote:
> Bumping this one up again. This patch is fairly contained and is a
> pre-requisite for drivers that want 4k at 60 mode support on HDMI.
>
Afaics Daniel Vetter replied ~4 months ago [1] with a link to a (imho)
more comprehensive series + a requested if Eric/others could take a
look. Considering that someone from the team have already been in the
area it should be trivial to acknowledge the request :-)

I'm guessing that his email got lost amongst the volume ?

Regards,
Emil

[1] https://lists.freedesktop.org/archives/dri-devel/2016-May/108484.html

/me mumbles something about top posting ;-)


[PATCH] drm: expand cea861 mode timing table

2016-09-01 Thread Harry Wentland
Bumping this one up again. This patch is fairly contained and is a 
pre-requisite for drivers that want 4k at 60 mode support on HDMI.

-Harry

On 2016-05-13 06:44 PM, Eric Yang wrote:
> This patch expand the cea861 mode timing table to include vic 65
> to 107. This allows more modes to be reported on newer displays,
> including 4k at 60Hz on HDMI, which was previously only reported if
> the display edid has a detailed timing descriptor block specifying
> the exact timing
>
> v2:
> - fix formating of the added modes to match the existing onces
>
> Signed-off-by: Eric Yang 
> ---
>   drivers/gpu/drm/drm_edid.c | 215 
> +
>   drivers/video/hdmi.c   |   4 +
>   include/linux/hdmi.h   |   2 +
>   3 files changed, 221 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 04cb487..4fb69ee 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -988,6 +988,221 @@ static const struct drm_display_mode edid_cea_modes[] = 
> {
>  2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
>  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
>.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
> + /* 65 - 1280x720 at 24Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59341, 1280, 3040,
> +3080, 3300, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> +   .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 66 - 1280x720 at 25Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
> +3740, 3960, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> +   .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 67 - 1280x720 at 30Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74176, 1280, 3040,
> +3080, 3300, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> +   .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 68 - 1280x720 at 50Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
> +1760, 1980, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> +   .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 69 - 1280x720 at 60Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74176, 1280, 1390,
> +1430, 1650, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> +   .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 70 - 1280x720 at 100Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
> +1760, 1980, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> +   .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 71 - 1280x720 at 120Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148352, 1280, 1390,
> +1430, 1650, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> +   .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 72 - 1920x1080 at 24Hz */
> + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74176, 1920, 2558,
> +2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> +   .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 73 - 1920x1080 at 25Hz */
> + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
> +2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> +   .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 74 - 1920x1080 at 30Hz */
> + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74176, 1920, 2008,
> +2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> +   .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 75 - 1920x1080 at 50Hz */
> + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
> +2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> +   .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 76 - 1920x1080 at 60Hz */
> + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148352, 1920, 2008,
> +2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> +   .vrefresh = 60, .picture_aspect_ratio = 

[PATCH] drm: expand cea861 mode timing table

2016-05-26 Thread Daniel Vetter
On Wed, May 25, 2016 at 07:55:23PM +, Yang, Eric wrote:
> Hi Thierry Reding,
> 
> enum hdmi_picture_aspect {
> >   HDMI_PICTURE_ASPECT_NONE,
> >   HDMI_PICTURE_ASPECT_4_3,
> >   HDMI_PICTURE_ASPECT_16_9,
> > + HDMI_PICTURE_ASPECT_64_27,
> > + HDMI_PICTURE_ASPECT_256_135,
> >   HDMI_PICTURE_ASPECT_RESERVED,
> >  };
> 
> These are defined since CEA861F defines them in section 4.1.  
> However, it is not indicated in AVI InfoFrame definition for picture aspect 
> ratio (M1,M0), and we should indicate (M1,M0) = (0,0) for "No Data" when 
> sending VICs corresponding to these new aspect ratios.
> 
> If (M1,M0) = (0,0) "No Data" is indicated, then If M=0 (M1=0, M0=0) and 
> VIC=0, a Sink shall assume the Picture is formatted according to the 
> Preferred Picture Aspect Ratio.
> 
> The defition:
> 
> Preferred Picture Aspect Ratio-In a Dual-Aspect Ratio DTV, the preferred 
> aspect ratio of a given Video Format Timing (e.g., 720x480p) is the aspect 
> ratio of the first such timing listed in the EDID data structure (see Section 
> 4.1). This would be the Picture Aspect Ratio that would be displayed if a DTV 
> were to receive a Video Format Timing with no accompanying Picture Aspect 
> Ratio information (i.e., no AVI sent from Source).
> 
> Alternatively, since our code does not actively use 
> HDMI_PICTURE_ASPECT_64_27, HDMI_PICTURE_ASPECT_256_135, we can unify them as 
> HDMI_PICTURE_ASPECT_NONE, and send (M1,M0) = (0,0) to avoid confusion.

There's already drm core patches to add all this stuff for the new aspect
ratios:

https://patchwork.freedesktop.org/series/4896/

Would be great if you can review them. Patch 5 of that series (for
i915.ko) needs to be polished a bit, but the other bits all look fine to
me at a quick glance.

Thanks, Daniel

> 
> 
> 
> -Original Message-
> From: Thierry Reding 
> Sent: Friday, May 13, 2016 11:28:39 AM
> To: Yang, Eric
> Cc: dri-devel at lists.freedesktop.org; linux-fbdev at vger.kernel.org; 
> tomi.valkeinen at ti.com; plagnioj at jcrosoft.com
> Subject: Re: [PATCH] drm: expand cea861 mode timing table
> 
> On Thu, May 12, 2016 at 03:37:33PM -0400, Eric Yang wrote:
> [...]
> > diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h index 
> > e974420..edbb4fc 100644
> > --- a/include/linux/hdmi.h
> > +++ b/include/linux/hdmi.h
> > @@ -78,6 +78,8 @@ enum hdmi_picture_aspect {
> >   HDMI_PICTURE_ASPECT_NONE,
> >   HDMI_PICTURE_ASPECT_4_3,
> >   HDMI_PICTURE_ASPECT_16_9,
> > + HDMI_PICTURE_ASPECT_64_27,
> > + HDMI_PICTURE_ASPECT_256_135,
> >   HDMI_PICTURE_ASPECT_RESERVED,
> >  };
> 
> Where did you get these from? I'm asking because I sent this patch last year 
> (or at least I wrote it and we discussed it on IRC, since I can't find an 
> email archive link to it), and back at the time the picture aspect ratio was 
> the big question mark. My recollection is that CEA-861-F introduces these new 
> picture aspect ratios in the mode tables but never specifies their values. As 
> a matter of fact, the AVI infoframe where these values are used only has 
> space for 4 values (none, 4:3, 16:9 and reserved).
> 
> Would you mind pointing me at the specification for these values?
> 
> Thanks,
> Thierry
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


[PATCH] drm: expand cea861 mode timing table

2016-05-25 Thread Yang, Eric
Hi Thierry Reding,

enum hdmi_picture_aspect {
>   HDMI_PICTURE_ASPECT_NONE,
>   HDMI_PICTURE_ASPECT_4_3,
>   HDMI_PICTURE_ASPECT_16_9,
> + HDMI_PICTURE_ASPECT_64_27,
> + HDMI_PICTURE_ASPECT_256_135,
>   HDMI_PICTURE_ASPECT_RESERVED,
>  };

These are defined since CEA861F defines them in section 4.1.  
However, it is not indicated in AVI InfoFrame definition for picture aspect 
ratio (M1,M0), and we should indicate (M1,M0) = (0,0) for "No Data" when 
sending VICs corresponding to these new aspect ratios.

If (M1,M0) = (0,0) "No Data" is indicated, then If M=0 (M1=0, M0=0) and VIC=0, 
a Sink shall assume the Picture is formatted according to the Preferred Picture 
Aspect Ratio.

The defition:

Preferred Picture Aspect Ratio-In a Dual-Aspect Ratio DTV, the preferred aspect 
ratio of a given Video Format Timing (e.g., 720x480p) is the aspect ratio of 
the first such timing listed in the EDID data structure (see Section 4.1). This 
would be the Picture Aspect Ratio that would be displayed if a DTV were to 
receive a Video Format Timing with no accompanying Picture Aspect Ratio 
information (i.e., no AVI sent from Source).

Alternatively, since our code does not actively use HDMI_PICTURE_ASPECT_64_27, 
HDMI_PICTURE_ASPECT_256_135, we can unify them as HDMI_PICTURE_ASPECT_NONE, and 
send (M1,M0) = (0,0) to avoid confusion.



-Original Message-
From: Thierry Reding <thierry.red...@gmail.com>
Sent: Friday, May 13, 2016 11:28:39 AM
To: Yang, Eric
Cc: dri-devel at lists.freedesktop.org; linux-fbdev at vger.kernel.org; 
tomi.valkeinen at ti.com; plagnioj at jcrosoft.com
Subject: Re: [PATCH] drm: expand cea861 mode timing table

On Thu, May 12, 2016 at 03:37:33PM -0400, Eric Yang wrote:
[...]
> diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h index 
> e974420..edbb4fc 100644
> --- a/include/linux/hdmi.h
> +++ b/include/linux/hdmi.h
> @@ -78,6 +78,8 @@ enum hdmi_picture_aspect {
>   HDMI_PICTURE_ASPECT_NONE,
>   HDMI_PICTURE_ASPECT_4_3,
>   HDMI_PICTURE_ASPECT_16_9,
> + HDMI_PICTURE_ASPECT_64_27,
> + HDMI_PICTURE_ASPECT_256_135,
>   HDMI_PICTURE_ASPECT_RESERVED,
>  };

Where did you get these from? I'm asking because I sent this patch last year 
(or at least I wrote it and we discussed it on IRC, since I can't find an email 
archive link to it), and back at the time the picture aspect ratio was the big 
question mark. My recollection is that CEA-861-F introduces these new picture 
aspect ratios in the mode tables but never specifies their values. As a matter 
of fact, the AVI infoframe where these values are used only has space for 4 
values (none, 4:3, 16:9 and reserved).

Would you mind pointing me at the specification for these values?

Thanks,
Thierry


[PATCH] drm: expand cea861 mode timing table

2016-05-13 Thread Yang, Eric
Hi Thierry Reding,

I will have to answer this question next week, the member of my team with a 
HDMI spec is not here today.

Hi Jani Nikula,
Thank you for noticing the formatting mistake, the checkpatch script did not 
catch this, I will prepare a new patch with the formatting fixed.

From: Thierry Reding <thierry.red...@gmail.com>
Sent: Friday, May 13, 2016 11:28:39 AM
To: Yang, Eric
Cc: dri-devel at lists.freedesktop.org; linux-fbdev at vger.kernel.org; 
tomi.valkeinen at ti.com; plagnioj at jcrosoft.com
Subject: Re: [PATCH] drm: expand cea861 mode timing table

On Thu, May 12, 2016 at 03:37:33PM -0400, Eric Yang wrote:
[...]
> diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
> index e974420..edbb4fc 100644
> --- a/include/linux/hdmi.h
> +++ b/include/linux/hdmi.h
> @@ -78,6 +78,8 @@ enum hdmi_picture_aspect {
>   HDMI_PICTURE_ASPECT_NONE,
>   HDMI_PICTURE_ASPECT_4_3,
>   HDMI_PICTURE_ASPECT_16_9,
> + HDMI_PICTURE_ASPECT_64_27,
> + HDMI_PICTURE_ASPECT_256_135,
>   HDMI_PICTURE_ASPECT_RESERVED,
>  };

Where did you get these from? I'm asking because I sent this patch last
year (or at least I wrote it and we discussed it on IRC, since I can't
find an email archive link to it), and back at the time the picture
aspect ratio was the big question mark. My recollection is that
CEA-861-F introduces these new picture aspect ratios in the mode tables
but never specifies their values. As a matter of fact, the AVI infoframe
where these values are used only has space for 4 values (none, 4:3, 16:9
and reserved).

Would you mind pointing me at the specification for these values?

Thanks,
Thierry


[PATCH] drm: expand cea861 mode timing table

2016-05-13 Thread Eric Yang
This patch expand the cea861 mode timing table to include vic 65
to 107. This allows more modes to be reported on newer displays,
including 4k at 60Hz on HDMI, which was previously only reported if
the display edid has a detailed timing descriptor block specifying
the exact timing

v2:
- fix formating of the added modes to match the existing onces

Signed-off-by: Eric Yang 
---
 drivers/gpu/drm/drm_edid.c | 215 +
 drivers/video/hdmi.c   |   4 +
 include/linux/hdmi.h   |   2 +
 3 files changed, 221 insertions(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 04cb487..4fb69ee 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -988,6 +988,221 @@ static const struct drm_display_mode edid_cea_modes[] = {
   2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
+   /* 65 - 1280x720 at 24Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59341, 1280, 3040,
+  3080, 3300, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+ .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 66 - 1280x720 at 25Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
+  3740, 3960, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+ .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 67 - 1280x720 at 30Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74176, 1280, 3040,
+  3080, 3300, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+ .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 68 - 1280x720 at 50Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
+  1760, 1980, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+ .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 69 - 1280x720 at 60Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74176, 1280, 1390,
+  1430, 1650, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+ .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 70 - 1280x720 at 100Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
+  1760, 1980, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+ .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 71 - 1280x720 at 120Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148352, 1280, 1390,
+  1430, 1650, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+ .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 72 - 1920x1080 at 24Hz */
+   { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74176, 1920, 2558,
+  2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+ .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 73 - 1920x1080 at 25Hz */
+   { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
+  2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+ .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 74 - 1920x1080 at 30Hz */
+   { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74176, 1920, 2008,
+  2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+ .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 75 - 1920x1080 at 50Hz */
+   { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
+  2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+ .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 76 - 1920x1080 at 60Hz */
+   { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148352, 1920, 2008,
+  2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+ .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 77 - 1920x1080 at 100Hz */
+   { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
+  2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
+  DRM_MODE_FLAG_PHSYNC | 

[PATCH] drm: expand cea861 mode timing table

2016-05-13 Thread Thierry Reding
On Thu, May 12, 2016 at 03:37:33PM -0400, Eric Yang wrote:
[...]
> diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
> index e974420..edbb4fc 100644
> --- a/include/linux/hdmi.h
> +++ b/include/linux/hdmi.h
> @@ -78,6 +78,8 @@ enum hdmi_picture_aspect {
>   HDMI_PICTURE_ASPECT_NONE,
>   HDMI_PICTURE_ASPECT_4_3,
>   HDMI_PICTURE_ASPECT_16_9,
> + HDMI_PICTURE_ASPECT_64_27,
> + HDMI_PICTURE_ASPECT_256_135,
>   HDMI_PICTURE_ASPECT_RESERVED,
>  };

Where did you get these from? I'm asking because I sent this patch last
year (or at least I wrote it and we discussed it on IRC, since I can't
find an email archive link to it), and back at the time the picture
aspect ratio was the big question mark. My recollection is that
CEA-861-F introduces these new picture aspect ratios in the mode tables
but never specifies their values. As a matter of fact, the AVI infoframe
where these values are used only has space for 4 values (none, 4:3, 16:9
and reserved).

Would you mind pointing me at the specification for these values?

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



[PATCH] drm: expand cea861 mode timing table

2016-05-13 Thread Jani Nikula
On Thu, 12 May 2016, Eric Yang  wrote:
> This patch expand the cea861 mode timing table to include vic 65
> to 107. This allows more modes to be reported on newer displays,
> including 4k at 60Hz on HDMI, which was previously only reported if
> the display edid has a detailed timing descriptor block specifying
> the exact timing

Just a quick drive-by note, please don't change the indentation in the
middle of the table.

BR,
Jani.

>
> Signed-off-by: Eric Yang 
> ---
>  drivers/gpu/drm/drm_edid.c | 215 
> +
>  drivers/video/hdmi.c   |   4 +
>  include/linux/hdmi.h   |   2 +
>  3 files changed, 221 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 04cb487..34ed001 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -988,6 +988,221 @@ static const struct drm_display_mode edid_cea_modes[] = 
> {
>  2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
>  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
>.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
> + /* 65 - 1280x720 at 24Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59341, 1280, 3040,
> +3080, 3300, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 66 - 1280x720 at 25Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
> +3740, 3960, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 67 - 1280x720 at 30Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74176, 1280, 3040,
> +3080, 3300, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 68 - 1280x720 at 50Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
> +1760, 1980, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 69 - 1280x720 at 60Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74176, 1280, 1390,
> +1430, 1650, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 70 - 1280x720 at 100Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
> +1760, 1980, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 71 - 1280x720 at 120Hz */
> + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148352, 1280, 1390,
> +1430, 1650, 0, 720, 725, 730, 750, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 72 - 1920x1080 at 24Hz */
> + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74176, 1920, 2558,
> +2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 73 - 1920x1080 at 25Hz */
> + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
> +2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 74 - 1920x1080 at 30Hz */
> + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74176, 1920, 2008,
> +2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 75 - 1920x1080 at 50Hz */
> + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
> +2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 76 - 1920x1080 at 60Hz */
> + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148352, 1920, 2008,
> +2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 77 - 1920x1080 at 100Hz */
> + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
> +2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
> +DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
> + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> + /* 78 - 

[PATCH] drm: expand cea861 mode timing table

2016-05-12 Thread Eric Yang
This patch expand the cea861 mode timing table to include vic 65
to 107. This allows more modes to be reported on newer displays,
including 4k at 60Hz on HDMI, which was previously only reported if
the display edid has a detailed timing descriptor block specifying
the exact timing

Signed-off-by: Eric Yang 
---
 drivers/gpu/drm/drm_edid.c | 215 +
 drivers/video/hdmi.c   |   4 +
 include/linux/hdmi.h   |   2 +
 3 files changed, 221 insertions(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 04cb487..34ed001 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -988,6 +988,221 @@ static const struct drm_display_mode edid_cea_modes[] = {
   2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
+   /* 65 - 1280x720 at 24Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59341, 1280, 3040,
+  3080, 3300, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+   .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 66 - 1280x720 at 25Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
+  3740, 3960, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+   .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 67 - 1280x720 at 30Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74176, 1280, 3040,
+  3080, 3300, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+   .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 68 - 1280x720 at 50Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
+  1760, 1980, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+   .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 69 - 1280x720 at 60Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74176, 1280, 1390,
+  1430, 1650, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+   .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 70 - 1280x720 at 100Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
+  1760, 1980, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+   .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 71 - 1280x720 at 120Hz */
+   { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148352, 1280, 1390,
+  1430, 1650, 0, 720, 725, 730, 750, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+   .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 72 - 1920x1080 at 24Hz */
+   { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74176, 1920, 2558,
+  2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+   .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 73 - 1920x1080 at 25Hz */
+   { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
+  2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+   .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 74 - 1920x1080 at 30Hz */
+   { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74176, 1920, 2008,
+  2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+   .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 75 - 1920x1080 at 50Hz */
+   { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
+  2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+   .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 76 - 1920x1080 at 60Hz */
+   { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148352, 1920, 2008,
+  2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+   .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 77 - 1920x1080 at 100Hz */
+   { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
+  2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
+  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
+   .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+   /* 78 - 1920x1080 at 120Hz */
+   { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 296704, 1920, 2008,
+  2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
+  DRM_MODE_FLAG_PHSYNC |