stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] drm: Fix primary plane size for stereo doubled modes for legacy setcrtc
@ 2015-11-16 15:02 ville.syrjala
  2015-11-17 10:54 ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: ville.syrjala @ 2015-11-16 15:02 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx, Daniel Vetter, stable

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Properly double the hdisplay/vdisplay timings that we use as the primary
plane size with stereo doubled modes. Otherwise the modeset gets
rejected on machines where the primary plane must be fullscreen, and on
the rest only the first eye would get a visible plane.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: stable@vger.kernel.org
Fixes: 042652ed9599 ("drm/atomic-helper: implementatations for legacy interfaces")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 9870c70..7857163 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1741,6 +1741,7 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
 	struct drm_crtc_state *crtc_state;
 	struct drm_plane_state *primary_state;
 	struct drm_crtc *crtc = set->crtc;
+	int hdisplay, vdisplay;
 	int ret;
 
 	crtc_state = drm_atomic_get_crtc_state(state, crtc);
@@ -1783,19 +1784,21 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
 	if (ret != 0)
 		return ret;
 
+	drm_crtc_get_hv_timing(set->mode, &hdisplay, &vdisplay);
+
 	drm_atomic_set_fb_for_plane(primary_state, set->fb);
 	primary_state->crtc_x = 0;
 	primary_state->crtc_y = 0;
-	primary_state->crtc_h = set->mode->vdisplay;
-	primary_state->crtc_w = set->mode->hdisplay;
+	primary_state->crtc_h = vdisplay;
+	primary_state->crtc_w = hdisplay;
 	primary_state->src_x = set->x << 16;
 	primary_state->src_y = set->y << 16;
 	if (primary_state->rotation & (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270))) {
-		primary_state->src_h = set->mode->hdisplay << 16;
-		primary_state->src_w = set->mode->vdisplay << 16;
+		primary_state->src_h = hdisplay << 16;
+		primary_state->src_w = vdisplay << 16;
 	} else {
-		primary_state->src_h = set->mode->vdisplay << 16;
-		primary_state->src_w = set->mode->hdisplay << 16;
+		primary_state->src_h = vdisplay << 16;
+		primary_state->src_w = hdisplay << 16;
 	}
 
 commit:
-- 
2.4.10


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/4] drm: Fix primary plane size for stereo doubled modes for legacy setcrtc
  2015-11-16 15:02 [PATCH 1/4] drm: Fix primary plane size for stereo doubled modes for legacy setcrtc ville.syrjala
@ 2015-11-17 10:54 ` Daniel Vetter
  2015-11-17 14:26   ` Jani Nikula
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2015-11-17 10:54 UTC (permalink / raw)
  To: ville.syrjala; +Cc: dri-devel, intel-gfx, Daniel Vetter, stable

On Mon, Nov 16, 2015 at 05:02:34PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> 
> Properly double the hdisplay/vdisplay timings that we use as the primary
> plane size with stereo doubled modes. Otherwise the modeset gets
> rejected on machines where the primary plane must be fullscreen, and on
> the rest only the first eye would get a visible plane.
> 
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: stable@vger.kernel.org
> Fixes: 042652ed9599 ("drm/atomic-helper: implementatations for legacy interfaces")
> Signed-off-by: Ville Syrj�l� <ville.syrjala@linux.intel.com>

Testcase: igt/kms_3d
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

To avoid conflicts with patches 2-4 I applied all of them to drm-misc, but
we need to cherry-pick this one to drm-fixes too.
-Daniel

> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 9870c70..7857163 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -1741,6 +1741,7 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
>  	struct drm_crtc_state *crtc_state;
>  	struct drm_plane_state *primary_state;
>  	struct drm_crtc *crtc = set->crtc;
> +	int hdisplay, vdisplay;
>  	int ret;
>  
>  	crtc_state = drm_atomic_get_crtc_state(state, crtc);
> @@ -1783,19 +1784,21 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
>  	if (ret != 0)
>  		return ret;
>  
> +	drm_crtc_get_hv_timing(set->mode, &hdisplay, &vdisplay);
> +
>  	drm_atomic_set_fb_for_plane(primary_state, set->fb);
>  	primary_state->crtc_x = 0;
>  	primary_state->crtc_y = 0;
> -	primary_state->crtc_h = set->mode->vdisplay;
> -	primary_state->crtc_w = set->mode->hdisplay;
> +	primary_state->crtc_h = vdisplay;
> +	primary_state->crtc_w = hdisplay;
>  	primary_state->src_x = set->x << 16;
>  	primary_state->src_y = set->y << 16;
>  	if (primary_state->rotation & (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270))) {
> -		primary_state->src_h = set->mode->hdisplay << 16;
> -		primary_state->src_w = set->mode->vdisplay << 16;
> +		primary_state->src_h = hdisplay << 16;
> +		primary_state->src_w = vdisplay << 16;
>  	} else {
> -		primary_state->src_h = set->mode->vdisplay << 16;
> -		primary_state->src_w = set->mode->hdisplay << 16;
> +		primary_state->src_h = vdisplay << 16;
> +		primary_state->src_w = hdisplay << 16;
>  	}
>  
>  commit:
> -- 
> 2.4.10
> 

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/4] drm: Fix primary plane size for stereo doubled modes for legacy setcrtc
  2015-11-17 10:54 ` Daniel Vetter
@ 2015-11-17 14:26   ` Jani Nikula
  0 siblings, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2015-11-17 14:26 UTC (permalink / raw)
  To: Daniel Vetter, ville.syrjala; +Cc: Daniel Vetter, intel-gfx, stable, dri-devel

On Tue, 17 Nov 2015, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Mon, Nov 16, 2015 at 05:02:34PM +0200, ville.syrjala@linux.intel.com wrote:
>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> 
>> Properly double the hdisplay/vdisplay timings that we use as the primary
>> plane size with stereo doubled modes. Otherwise the modeset gets
>> rejected on machines where the primary plane must be fullscreen, and on
>> the rest only the first eye would get a visible plane.
>> 
>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>> Cc: stable@vger.kernel.org
>> Fixes: 042652ed9599 ("drm/atomic-helper: implementatations for legacy interfaces")
>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Testcase: igt/kms_3d
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> To avoid conflicts with patches 2-4 I applied all of them to drm-misc, but
> we need to cherry-pick this one to drm-fixes too.

Picked up in topic/drm-fixes.

BR,
Jani.


> -Daniel
>
>> ---
>>  drivers/gpu/drm/drm_atomic_helper.c | 15 +++++++++------
>>  1 file changed, 9 insertions(+), 6 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
>> index 9870c70..7857163 100644
>> --- a/drivers/gpu/drm/drm_atomic_helper.c
>> +++ b/drivers/gpu/drm/drm_atomic_helper.c
>> @@ -1741,6 +1741,7 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
>>  	struct drm_crtc_state *crtc_state;
>>  	struct drm_plane_state *primary_state;
>>  	struct drm_crtc *crtc = set->crtc;
>> +	int hdisplay, vdisplay;
>>  	int ret;
>>  
>>  	crtc_state = drm_atomic_get_crtc_state(state, crtc);
>> @@ -1783,19 +1784,21 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
>>  	if (ret != 0)
>>  		return ret;
>>  
>> +	drm_crtc_get_hv_timing(set->mode, &hdisplay, &vdisplay);
>> +
>>  	drm_atomic_set_fb_for_plane(primary_state, set->fb);
>>  	primary_state->crtc_x = 0;
>>  	primary_state->crtc_y = 0;
>> -	primary_state->crtc_h = set->mode->vdisplay;
>> -	primary_state->crtc_w = set->mode->hdisplay;
>> +	primary_state->crtc_h = vdisplay;
>> +	primary_state->crtc_w = hdisplay;
>>  	primary_state->src_x = set->x << 16;
>>  	primary_state->src_y = set->y << 16;
>>  	if (primary_state->rotation & (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270))) {
>> -		primary_state->src_h = set->mode->hdisplay << 16;
>> -		primary_state->src_w = set->mode->vdisplay << 16;
>> +		primary_state->src_h = hdisplay << 16;
>> +		primary_state->src_w = vdisplay << 16;
>>  	} else {
>> -		primary_state->src_h = set->mode->vdisplay << 16;
>> -		primary_state->src_w = set->mode->hdisplay << 16;
>> +		primary_state->src_h = vdisplay << 16;
>> +		primary_state->src_w = hdisplay << 16;
>>  	}
>>  
>>  commit:
>> -- 
>> 2.4.10
>> 

-- 
Jani Nikula, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-17 14:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-16 15:02 [PATCH 1/4] drm: Fix primary plane size for stereo doubled modes for legacy setcrtc ville.syrjala
2015-11-17 10:54 ` Daniel Vetter
2015-11-17 14:26   ` Jani Nikula

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).