[Intel-gfx] [PATCH 6/6] drm/i915: Reject page flips with changed format/offset/pitch

2012-07-19 Thread Daniel Vetter
On Thu, Jul 19, 2012 at 02:27:47PM +0200, Laurent Pinchart wrote:
> Hi Daniel,
> 
> On Thursday 05 July 2012 13:31:17 Daniel Vetter wrote:
> > On Thu, May 24, 2012 at 09:08:59PM +0300, ville.syrjala at linux.intel.com 
> wrote:
> > > From: Ville Syrj?l? 
> > > 
> > > MI display flips can't handle some changes in the framebuffer
> > > format or layout. Return an error in such cases.
> > > 
> > > Signed-off-by: Ville Syrj?l? 
> > 
> > Queued for -next, thanks for the patch. I've punted on the others, hoping
> > for a few i-g-t tests (and maybe someone else that could review them).
> > Safe for the uninitialized stack var patch and this one, because we need
> > this check to fix up gen4+ tileoffset limitations.
> > 
> > Yours, Daniel
> > 
> > > ---
> > > 
> > >  drivers/gpu/drm/i915/intel_display.c |   13 +
> > >  1 files changed, 13 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c
> > > b/drivers/gpu/drm/i915/intel_display.c index f4338cb..72ac2f9 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -6217,6 +6217,19 @@ static int intel_crtc_page_flip(struct drm_crtc
> > > *crtc,> 
> > >   unsigned long flags;
> > >   int ret;
> > > 
> > > + /* Can't change pixel format via MI display flips. */
> > > + if (fb->pixel_format != crtc->fb->pixel_format)
> > > + return -EINVAL;
> 
> Is this still needed if we apply my "drm: Don't allow page flip to change 
> pixel format" patch ?

Actually, drm/i915 is on track to grow itself a complete new modeset
implementation which does not use the crtc helpers (at least as little as
possible). See

http://cgit.freedesktop.org/~danvet/drm/log/?h=modeset-rework

Cheers, Daniel

> 
> > > + /*
> > > +  * TILEOFF/LINOFF registers can't be changed via MI display flips.
> > > +  * Note that pitch changes could also affect these register.
> > > +  */
> > > + if (INTEL_INFO(dev)->gen > 3 &&
> > > + (fb->offsets[0] != crtc->fb->offsets[0] ||
> > > +  fb->pitches[0] != crtc->fb->pitches[0]))
> > > + return -EINVAL;
> > > +
> > > 
> > >   work = kzalloc(sizeof *work, GFP_KERNEL);
> > >   if (work == NULL)
> > >   
> > >   return -ENOMEM;
> 
> -- 
> Regards,
> 
> Laurent Pinchart
> 

-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48


[Intel-gfx] [PATCH 6/6] drm/i915: Reject page flips with changed format/offset/pitch

2012-07-19 Thread Laurent Pinchart
Hi Daniel,

On Thursday 05 July 2012 13:31:17 Daniel Vetter wrote:
> On Thu, May 24, 2012 at 09:08:59PM +0300, ville.syrjala at linux.intel.com 
wrote:
> > From: Ville Syrj?l? 
> > 
> > MI display flips can't handle some changes in the framebuffer
> > format or layout. Return an error in such cases.
> > 
> > Signed-off-by: Ville Syrj?l? 
> 
> Queued for -next, thanks for the patch. I've punted on the others, hoping
> for a few i-g-t tests (and maybe someone else that could review them).
> Safe for the uninitialized stack var patch and this one, because we need
> this check to fix up gen4+ tileoffset limitations.
> 
> Yours, Daniel
> 
> > ---
> > 
> >  drivers/gpu/drm/i915/intel_display.c |   13 +
> >  1 files changed, 13 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c
> > b/drivers/gpu/drm/i915/intel_display.c index f4338cb..72ac2f9 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -6217,6 +6217,19 @@ static int intel_crtc_page_flip(struct drm_crtc
> > *crtc,> 
> > unsigned long flags;
> > int ret;
> > 
> > +   /* Can't change pixel format via MI display flips. */
> > +   if (fb->pixel_format != crtc->fb->pixel_format)
> > +   return -EINVAL;

Is this still needed if we apply my "drm: Don't allow page flip to change 
pixel format" patch ?

> > +   /*
> > +* TILEOFF/LINOFF registers can't be changed via MI display flips.
> > +* Note that pitch changes could also affect these register.
> > +*/
> > +   if (INTEL_INFO(dev)->gen > 3 &&
> > +   (fb->offsets[0] != crtc->fb->offsets[0] ||
> > +fb->pitches[0] != crtc->fb->pitches[0]))
> > +   return -EINVAL;
> > +
> > 
> > work = kzalloc(sizeof *work, GFP_KERNEL);
> > if (work == NULL)
> > 
> > return -ENOMEM;

-- 
Regards,

Laurent Pinchart



Re: [Intel-gfx] [PATCH 6/6] drm/i915: Reject page flips with changed format/offset/pitch

2012-07-19 Thread Laurent Pinchart
Hi Daniel,

On Thursday 05 July 2012 13:31:17 Daniel Vetter wrote:
 On Thu, May 24, 2012 at 09:08:59PM +0300, ville.syrj...@linux.intel.com 
wrote:
  From: Ville Syrjälä ville.syrj...@linux.intel.com
  
  MI display flips can't handle some changes in the framebuffer
  format or layout. Return an error in such cases.
  
  Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com
 
 Queued for -next, thanks for the patch. I've punted on the others, hoping
 for a few i-g-t tests (and maybe someone else that could review them).
 Safe for the uninitialized stack var patch and this one, because we need
 this check to fix up gen4+ tileoffset limitations.
 
 Yours, Daniel
 
  ---
  
   drivers/gpu/drm/i915/intel_display.c |   13 +
   1 files changed, 13 insertions(+), 0 deletions(-)
  
  diff --git a/drivers/gpu/drm/i915/intel_display.c
  b/drivers/gpu/drm/i915/intel_display.c index f4338cb..72ac2f9 100644
  --- a/drivers/gpu/drm/i915/intel_display.c
  +++ b/drivers/gpu/drm/i915/intel_display.c
  @@ -6217,6 +6217,19 @@ static int intel_crtc_page_flip(struct drm_crtc
  *crtc, 
  unsigned long flags;
  int ret;
  
  +   /* Can't change pixel format via MI display flips. */
  +   if (fb-pixel_format != crtc-fb-pixel_format)
  +   return -EINVAL;

Is this still needed if we apply my drm: Don't allow page flip to change 
pixel format patch ?

  +   /*
  +* TILEOFF/LINOFF registers can't be changed via MI display flips.
  +* Note that pitch changes could also affect these register.
  +*/
  +   if (INTEL_INFO(dev)-gen  3 
  +   (fb-offsets[0] != crtc-fb-offsets[0] ||
  +fb-pitches[0] != crtc-fb-pitches[0]))
  +   return -EINVAL;
  +
  
  work = kzalloc(sizeof *work, GFP_KERNEL);
  if (work == NULL)
  
  return -ENOMEM;

-- 
Regards,

Laurent Pinchart

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


Re: [Intel-gfx] [PATCH 6/6] drm/i915: Reject page flips with changed format/offset/pitch

2012-07-19 Thread Daniel Vetter
On Thu, Jul 19, 2012 at 02:27:47PM +0200, Laurent Pinchart wrote:
 Hi Daniel,
 
 On Thursday 05 July 2012 13:31:17 Daniel Vetter wrote:
  On Thu, May 24, 2012 at 09:08:59PM +0300, ville.syrj...@linux.intel.com 
 wrote:
   From: Ville Syrjälä ville.syrj...@linux.intel.com
   
   MI display flips can't handle some changes in the framebuffer
   format or layout. Return an error in such cases.
   
   Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com
  
  Queued for -next, thanks for the patch. I've punted on the others, hoping
  for a few i-g-t tests (and maybe someone else that could review them).
  Safe for the uninitialized stack var patch and this one, because we need
  this check to fix up gen4+ tileoffset limitations.
  
  Yours, Daniel
  
   ---
   
drivers/gpu/drm/i915/intel_display.c |   13 +
1 files changed, 13 insertions(+), 0 deletions(-)
   
   diff --git a/drivers/gpu/drm/i915/intel_display.c
   b/drivers/gpu/drm/i915/intel_display.c index f4338cb..72ac2f9 100644
   --- a/drivers/gpu/drm/i915/intel_display.c
   +++ b/drivers/gpu/drm/i915/intel_display.c
   @@ -6217,6 +6217,19 @@ static int intel_crtc_page_flip(struct drm_crtc
   *crtc, 
 unsigned long flags;
 int ret;
   
   + /* Can't change pixel format via MI display flips. */
   + if (fb-pixel_format != crtc-fb-pixel_format)
   + return -EINVAL;
 
 Is this still needed if we apply my drm: Don't allow page flip to change 
 pixel format patch ?

Actually, drm/i915 is on track to grow itself a complete new modeset
implementation which does not use the crtc helpers (at least as little as
possible). See

http://cgit.freedesktop.org/~danvet/drm/log/?h=modeset-rework

Cheers, Daniel

 
   + /*
   +  * TILEOFF/LINOFF registers can't be changed via MI display flips.
   +  * Note that pitch changes could also affect these register.
   +  */
   + if (INTEL_INFO(dev)-gen  3 
   + (fb-offsets[0] != crtc-fb-offsets[0] ||
   +  fb-pitches[0] != crtc-fb-pitches[0]))
   + return -EINVAL;
   +
   
 work = kzalloc(sizeof *work, GFP_KERNEL);
 if (work == NULL)
 
 return -ENOMEM;
 
 -- 
 Regards,
 
 Laurent Pinchart
 

-- 
Daniel Vetter
Mail: dan...@ffwll.ch
Mobile: +41 (0)79 365 57 48
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Intel-gfx] [PATCH 6/6] drm/i915: Reject page flips with changed format/offset/pitch

2012-07-05 Thread Daniel Vetter
On Thu, May 24, 2012 at 09:08:59PM +0300, ville.syrjala at linux.intel.com 
wrote:
> From: Ville Syrj?l? 
> 
> MI display flips can't handle some changes in the framebuffer
> format or layout. Return an error in such cases.
> 
> Signed-off-by: Ville Syrj?l? 
Queued for -next, thanks for the patch. I've punted on the others, hoping
for a few i-g-t tests (and maybe someone else that could review them).
Safe for the uninitialized stack var patch and this one, because we need
this check to fix up gen4+ tileoffset limitations.

Yours, Daniel
> ---
>  drivers/gpu/drm/i915/intel_display.c |   13 +
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c 
> b/drivers/gpu/drm/i915/intel_display.c
> index f4338cb..72ac2f9 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -6217,6 +6217,19 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
>   unsigned long flags;
>   int ret;
>  
> + /* Can't change pixel format via MI display flips. */
> + if (fb->pixel_format != crtc->fb->pixel_format)
> + return -EINVAL;
> +
> + /*
> +  * TILEOFF/LINOFF registers can't be changed via MI display flips.
> +  * Note that pitch changes could also affect these register.
> +  */
> + if (INTEL_INFO(dev)->gen > 3 &&
> + (fb->offsets[0] != crtc->fb->offsets[0] ||
> +  fb->pitches[0] != crtc->fb->pitches[0]))
> + return -EINVAL;
> +
>   work = kzalloc(sizeof *work, GFP_KERNEL);
>   if (work == NULL)
>   return -ENOMEM;
> -- 
> 1.7.3.4
> 
> ___
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48


Re: [Intel-gfx] [PATCH 6/6] drm/i915: Reject page flips with changed format/offset/pitch

2012-07-05 Thread Daniel Vetter
On Thu, May 24, 2012 at 09:08:59PM +0300, ville.syrj...@linux.intel.com wrote:
 From: Ville Syrjälä ville.syrj...@linux.intel.com
 
 MI display flips can't handle some changes in the framebuffer
 format or layout. Return an error in such cases.
 
 Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com
Queued for -next, thanks for the patch. I've punted on the others, hoping
for a few i-g-t tests (and maybe someone else that could review them).
Safe for the uninitialized stack var patch and this one, because we need
this check to fix up gen4+ tileoffset limitations.

Yours, Daniel
 ---
  drivers/gpu/drm/i915/intel_display.c |   13 +
  1 files changed, 13 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/gpu/drm/i915/intel_display.c 
 b/drivers/gpu/drm/i915/intel_display.c
 index f4338cb..72ac2f9 100644
 --- a/drivers/gpu/drm/i915/intel_display.c
 +++ b/drivers/gpu/drm/i915/intel_display.c
 @@ -6217,6 +6217,19 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
   unsigned long flags;
   int ret;
  
 + /* Can't change pixel format via MI display flips. */
 + if (fb-pixel_format != crtc-fb-pixel_format)
 + return -EINVAL;
 +
 + /*
 +  * TILEOFF/LINOFF registers can't be changed via MI display flips.
 +  * Note that pitch changes could also affect these register.
 +  */
 + if (INTEL_INFO(dev)-gen  3 
 + (fb-offsets[0] != crtc-fb-offsets[0] ||
 +  fb-pitches[0] != crtc-fb-pitches[0]))
 + return -EINVAL;
 +
   work = kzalloc(sizeof *work, GFP_KERNEL);
   if (work == NULL)
   return -ENOMEM;
 -- 
 1.7.3.4
 
 ___
 Intel-gfx mailing list
 intel-...@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Mail: dan...@ffwll.ch
Mobile: +41 (0)79 365 57 48
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 6/6] drm/i915: Reject page flips with changed format/offset/pitch

2012-05-24 Thread ville.syrj...@linux.intel.com
From: Ville Syrj?l? 

MI display flips can't handle some changes in the framebuffer
format or layout. Return an error in such cases.

Signed-off-by: Ville Syrj?l? 
---
 drivers/gpu/drm/i915/intel_display.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index f4338cb..72ac2f9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6217,6 +6217,19 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
unsigned long flags;
int ret;

+   /* Can't change pixel format via MI display flips. */
+   if (fb->pixel_format != crtc->fb->pixel_format)
+   return -EINVAL;
+
+   /*
+* TILEOFF/LINOFF registers can't be changed via MI display flips.
+* Note that pitch changes could also affect these register.
+*/
+   if (INTEL_INFO(dev)->gen > 3 &&
+   (fb->offsets[0] != crtc->fb->offsets[0] ||
+fb->pitches[0] != crtc->fb->pitches[0]))
+   return -EINVAL;
+
work = kzalloc(sizeof *work, GFP_KERNEL);
if (work == NULL)
return -ENOMEM;
-- 
1.7.3.4



[PATCH 6/6] drm/i915: Reject page flips with changed format/offset/pitch

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com

MI display flips can't handle some changes in the framebuffer
format or layout. Return an error in such cases.

Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com
---
 drivers/gpu/drm/i915/intel_display.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index f4338cb..72ac2f9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6217,6 +6217,19 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
unsigned long flags;
int ret;
 
+   /* Can't change pixel format via MI display flips. */
+   if (fb-pixel_format != crtc-fb-pixel_format)
+   return -EINVAL;
+
+   /*
+* TILEOFF/LINOFF registers can't be changed via MI display flips.
+* Note that pitch changes could also affect these register.
+*/
+   if (INTEL_INFO(dev)-gen  3 
+   (fb-offsets[0] != crtc-fb-offsets[0] ||
+fb-pitches[0] != crtc-fb-pitches[0]))
+   return -EINVAL;
+
work = kzalloc(sizeof *work, GFP_KERNEL);
if (work == NULL)
return -ENOMEM;
-- 
1.7.3.4

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