public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Thomas Wood <thomas.wood@intel.com>
To: ville.syrjala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH] drm: add support for additional stereo 3D modes
Date: Tue, 15 Oct 2013 18:25:26 +0100	[thread overview]
Message-ID: <1381857927-3712-1-git-send-email-thomas.wood@intel.com> (raw)
In-Reply-To: <20131011111214.GT13047@intel.com>

On 11 October 2013 12:12, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Thu, Oct 10, 2013 at 02:19:15PM +0100, Thomas Wood wrote:
>> Parse the 3D_Structure_ALL and 3D_MASK fields of the HDMI Vendor
>> Specific Data Block to expose more stereo 3D modes.
>>
>> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
>> ---
>>  drivers/gpu/drm/drm_edid.c | 93 ++++++++++++++++++++++++++++++++++++++++++----
>>  1 file changed, 85 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 9e81609..b3949f9 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -2652,6 +2652,50 @@ static int add_hdmi_mode(struct drm_connector *connector, u8 vic)
>>       return 1;
>>  }
>>
>> +static int add_3d_struct_modes(struct drm_connector *connector, u16 structure,
>> +                            const u8 *video_db, u8 video_len, u8 video_index)
>> +{
>> +     struct drm_device *dev = connector->dev;
>> +     struct drm_display_mode *newmode;
>> +     int modes = 0;
>> +     u8 cea_mode;
>> +
>> +     if (video_db == NULL || video_index > video_len)
>> +             return 0;
>> +
>> +     /* CEA modes are numbered 1..127 */
>> +     cea_mode = (video_db[video_index] & 127) - 1;
>> +     if (cea_mode >= ARRAY_SIZE(edid_cea_modes))
>> +             return 0;
>> +
>> +     if (structure & 1) {
>
> Could use (1 << 0) for consistency.

I've updated this for v2.

>
> I'm also wondering if some displays might include some of the mandatory
> modes in 3D_Structure_ALL, and if so should we filter out the
> duplicates?

As Damien mentioned, duplicates are filtered out later on.

>
>> +     if ((multi_present == 1 || multi_present == 2) &&
>> +         len >= (9 + offset)) {
>
> If multi_present==2 and len is too small for the mask, I think we should
> skip adding the modes since the block is clearly incorrect/corrupted.
>
> So maybe just something like this:
>  if ((multi_present == 1 && len < (9 + offset)) ||
>      (multi_present == 2 && len < (11 + offset)))
>      goto out;

I've added this check to v2 and also made sure multi_present is either 1 or 2
before continuing.

>
> I would also add a similar check for HDMI_3D_LEN since that is
> supposed to include the space required by 3D_Structure_ALL and
> 3D_MASK. Or you could just check HDMI_3D_LEN against 'len' and bail
> out if that doesn't fit. And then you could just check
> 3D_Structure_ALL and 3D_MASK against HDMI_3D_LEN.
>

I've added a check to ensure the value of HDMI_3D_LEN is large enough to
include 3D_Structure_ALL and 3D_MASK, if they are present.

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2013-10-15 17:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-10 13:19 [PATCH] drm: add support for additional stereo 3D modes Thomas Wood
2013-10-11 11:12 ` [Intel-gfx] " Ville Syrjälä
2013-10-11 12:09   ` Damien Lespiau
2013-10-15 17:25   ` Thomas Wood [this message]
2013-10-15 17:25     ` [PATCH v2] " Thomas Wood
2013-10-15 17:55       ` Ville Syrjälä
2013-10-16 14:58         ` [PATCH v3] " Thomas Wood
2013-10-16 15:07           ` Ville Syrjälä
2013-10-16 17:48             ` Daniel Vetter
2013-10-11 15:59 ` [PATCH] " Damien Lespiau

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=1381857927-3712-1-git-send-email-thomas.wood@intel.com \
    --to=thomas.wood@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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