dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Damien Lespiau <damien.lespiau@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 11/12] drm: Make drm_match_cea_mode() return the underlying 2D VIC for 3d modes
Date: Tue, 17 Sep 2013 11:22:26 +0300	[thread overview]
Message-ID: <20130917082226.GQ4531@intel.com> (raw)
In-Reply-To: <1379353735-4472-12-git-send-email-damien.lespiau@intel.com>

On Mon, Sep 16, 2013 at 06:48:54PM +0100, Damien Lespiau wrote:
> When scanning out a stereo mode, the AVI infoframe vic field has to be
> the underlyng 2D VIC. Before that commit, we weren't matching the CEA
> mode because of the extra stereo flag and then were setting the VIC
> field in the AVI infoframe to 0.

I think this is where we hit problems. How do we identify the 2D VIC
when the timings of the adjusted mode got mangled already to include
both eyes?

> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/drm_edid.c  |  4 ++--
>  drivers/gpu/drm/drm_modes.c | 18 ++++++++++++------
>  include/drm/drm_crtc.h      |  2 +-
>  3 files changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 9a36b6e..6b74698 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -2401,7 +2401,7 @@ u8 drm_match_cea_mode(const struct drm_display_mode *to_match)
>  
>  		if ((KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock1) ||
>  		     KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock2)) &&
> -		    drm_mode_equal_no_clocks(to_match, cea_mode))
> +		    drm_mode_equal_no_clocks_no_stereo(to_match, cea_mode))
>  			return mode + 1;
>  	}
>  	return 0;
> @@ -2450,7 +2450,7 @@ static u8 drm_match_hdmi_mode(const struct drm_display_mode *to_match)
>  
>  		if ((KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock1) ||
>  		     KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock2)) &&
> -		    drm_mode_equal_no_clocks(to_match, hdmi_mode))
> +		    drm_mode_equal_no_clocks_no_stereo(to_match, hdmi_mode))
>  			return mode + 1;
>  	}
>  	return 0;
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 504a602..76adee0 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -851,12 +851,16 @@ bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_displ
>  	} else if (mode1->clock != mode2->clock)
>  		return false;
>  
> -	return drm_mode_equal_no_clocks(mode1, mode2);
> +	if ((mode1->flags & DRM_MODE_FLAG_3D_MASK) !=
> +	    (mode2->flags & DRM_MODE_FLAG_3D_MASK))
> +		return false;
> +
> +	return drm_mode_equal_no_clocks_no_stereo(mode1, mode2);
>  }
>  EXPORT_SYMBOL(drm_mode_equal);
>  
>  /**
> - * drm_mode_equal_no_clocks - test modes for equality
> + * drm_mode_equal_no_clocks_no_stereo - test modes for equality
>   * @mode1: first mode
>   * @mode2: second mode
>   *
> @@ -864,12 +868,13 @@ EXPORT_SYMBOL(drm_mode_equal);
>   * None.
>   *
>   * Check to see if @mode1 and @mode2 are equivalent, but
> - * don't check the pixel clocks.
> + * don't check the pixel clocks nor the stereo layout.
>   *
>   * RETURNS:
>   * True if the modes are equal, false otherwise.
>   */
> -bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2)
> +bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1,
> +					const struct drm_display_mode *mode2)
>  {
>  	if (mode1->hdisplay == mode2->hdisplay &&
>  	    mode1->hsync_start == mode2->hsync_start &&
> @@ -881,12 +886,13 @@ bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct
>  	    mode1->vsync_end == mode2->vsync_end &&
>  	    mode1->vtotal == mode2->vtotal &&
>  	    mode1->vscan == mode2->vscan &&
> -	    mode1->flags == mode2->flags)
> +	    (mode1->flags & ~DRM_MODE_FLAG_3D_MASK) ==
> +	     (mode2->flags & ~DRM_MODE_FLAG_3D_MASK))
>  		return true;
>  
>  	return false;
>  }
> -EXPORT_SYMBOL(drm_mode_equal_no_clocks);
> +EXPORT_SYMBOL(drm_mode_equal_no_clocks_no_stereo);
>  
>  /**
>   * drm_mode_validate_size - make sure modes adhere to size constraints
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index e685baf..f0c5530 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -943,7 +943,7 @@ extern void drm_mode_config_reset(struct drm_device *dev);
>  extern void drm_mode_config_cleanup(struct drm_device *dev);
>  extern void drm_mode_set_name(struct drm_display_mode *mode);
>  extern bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
> -extern bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
> +extern bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
>  extern int drm_mode_width(const struct drm_display_mode *mode);
>  extern int drm_mode_height(const struct drm_display_mode *mode);
>  
> -- 
> 1.8.3.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2013-09-17  8:22 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16 17:48 HDMI stereo support v4 Damien Lespiau
2013-09-16 17:48 ` [PATCH 01/12] drm: Move the GET_CAP macros next to the corresponding ioctl structure Damien Lespiau
2013-09-16 17:48 ` [PATCH 02/12] drm: Add a SET_CLIENT_CAP ioctl Damien Lespiau
2013-09-16 17:48 ` [PATCH 03/12] drm: Add HDMI stereo 3D flags to struct drm_mode_modeinfo Damien Lespiau
2013-09-16 17:48 ` [PATCH 04/12] drm: Add a STEREO_3D capability to the SET_CLIENT_CAP ioctl Damien Lespiau
2013-09-16 17:48 ` [PATCH 05/12] drm/edid: Expose mandatory stereo modes for HDMI sinks Damien Lespiau
2013-09-16 18:29   ` Ville Syrjälä
2013-09-16 21:28     ` Damien Lespiau
2013-09-17 13:48     ` Damien Lespiau
2013-09-16 17:48 ` [PATCH 06/12] drm: Extract add_hdmi_mode() out of do_hdmi_vsdb_modes() Damien Lespiau
2013-09-16 17:48 ` [PATCH 07/12] drm: Reject modes with more than 1 stereo flags set Damien Lespiau
2013-09-16 17:48 ` [PATCH 08/12] drm: Set the relevant infoframe field when scanning out a 3D mode Damien Lespiau
2013-09-16 18:59   ` Ville Syrjälä
2013-09-16 17:48 ` [PATCH 09/12] drm: Track the number of buffers that compose a framebuffer Damien Lespiau
2013-09-16 17:48 ` [PATCH 10/12] drm: Don't allow multiple buffers fb with stereo modes Damien Lespiau
2013-09-17  8:20   ` [Intel-gfx] " Ville Syrjälä
2013-09-17  9:03     ` Damien Lespiau
2013-09-17  9:54       ` Ville Syrjälä
2013-09-17 10:37         ` [Intel-gfx] " Daniel Vetter
2013-09-17 11:02           ` Ville Syrjälä
2013-09-17 13:34             ` [Intel-gfx] " Daniel Vetter
2013-09-17 13:20           ` Damien Lespiau
2013-09-17 13:32             ` Ville Syrjälä
2013-09-17 13:33             ` [Intel-gfx] " Daniel Vetter
2013-09-16 17:48 ` [PATCH 11/12] drm: Make drm_match_cea_mode() return the underlying 2D VIC for 3d modes Damien Lespiau
2013-09-17  8:22   ` Ville Syrjälä [this message]
2013-09-17  8:52     ` [Intel-gfx] " Damien Lespiau
2013-09-16 17:48 ` [PATCH 12/12] drm: Carry over the stereo flags when adding the alternate mode Damien Lespiau
2013-09-17  9:17 ` HDMI stereo support v4 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=20130917082226.GQ4531@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=damien.lespiau@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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;
as well as URLs for NNTP newsgroup(s).