Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Chris Wilson
On Tue, Jun 17, 2014 at 11:54:16AM +0200, Daniel Vetter wrote: > On Tue, Jun 17, 2014 at 11:42 AM, Chris Wilson > wrote: > > Yes, having s/flip/flush/ is preferrable from a consistency pov. I am > > just not yet sold on that setplane is a intel_fb_flush. I think the busy > > state tracking on the

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Daniel Vetter
On Tue, Jun 17, 2014 at 11:42 AM, Chris Wilson wrote: > Yes, having s/flip/flush/ is preferrable from a consistency pov. I am > just not yet sold on that setplane is a intel_fb_flush. I think the busy > state tracking on the new fb is distinct from the state tracking on the > old fb, and we are ma

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Chris Wilson
On Tue, Jun 17, 2014 at 11:33:41AM +0200, Daniel Vetter wrote: > On Tue, Jun 17, 2014 at 09:10:14AM +0100, Chris Wilson wrote: > > On Tue, Jun 17, 2014 at 09:52:17AM +0200, Daniel Vetter wrote: > > > On Tue, Jun 17, 2014 at 08:00:05AM +0100, Chris Wilson wrote: > > > > On Mon, Jun 16, 2014 at 07:51

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Daniel Vetter
On Tue, Jun 17, 2014 at 09:10:14AM +0100, Chris Wilson wrote: > On Tue, Jun 17, 2014 at 09:52:17AM +0200, Daniel Vetter wrote: > > On Tue, Jun 17, 2014 at 08:00:05AM +0100, Chris Wilson wrote: > > > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > > > diff --git a/drivers/gpu/drm/

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Daniel Vetter
On Tue, Jun 17, 2014 at 08:53:47AM +0100, Chris Wilson wrote: > On Tue, Jun 17, 2014 at 09:45:00AM +0200, Daniel Vetter wrote: > > On Tue, Jun 17, 2014 at 07:54:38AM +0100, Chris Wilson wrote: > > > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > > > +/** > > > > + * intel_frontb

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Daniel Vetter
On Tue, Jun 17, 2014 at 08:36:48AM +0100, Chris Wilson wrote: > On Tue, Jun 17, 2014 at 09:32:47AM +0200, Daniel Vetter wrote: > > On Tue, Jun 17, 2014 at 07:41:48AM +0100, Chris Wilson wrote: > > > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > > > diff --git a/drivers/gpu/drm/

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Chris Wilson
On Tue, Jun 17, 2014 at 09:52:17AM +0200, Daniel Vetter wrote: > On Tue, Jun 17, 2014 at 08:00:05AM +0100, Chris Wilson wrote: > > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > > diff --git a/drivers/gpu/drm/i915/intel_display.c > > > b/drivers/gpu/drm/i915/intel_display.c > >

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Chris Wilson
On Tue, Jun 17, 2014 at 09:48:39AM +0200, Daniel Vetter wrote: > On Tue, Jun 17, 2014 at 07:57:22AM +0100, Chris Wilson wrote: > > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > > +/** > > > + * intel_fb_flip_prepare - flip frontbuffer > > > + * @obj: GEM object to flush > > > +

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Chris Wilson
On Tue, Jun 17, 2014 at 09:45:00AM +0200, Daniel Vetter wrote: > On Tue, Jun 17, 2014 at 07:54:38AM +0100, Chris Wilson wrote: > > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > > +/** > > > + * intel_frontbuffer_flush - flush frontbuffer > > > + * @dev: DRM device > > > + * @fr

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Daniel Vetter
On Tue, Jun 17, 2014 at 08:00:05AM +0100, Chris Wilson wrote: > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > diff --git a/drivers/gpu/drm/i915/intel_display.c > > b/drivers/gpu/drm/i915/intel_display.c > > index b8359f4a6dc4..dfdbf2a02844 100644 > > --- a/drivers/gpu/drm/i915

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Daniel Vetter
On Tue, Jun 17, 2014 at 07:57:22AM +0100, Chris Wilson wrote: > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > +/** > > + * intel_fb_flip_prepare - flip frontbuffer > > + * @obj: GEM object to flush > > + * > > + * This function gets called after scheduling a flip on @obj. The a

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Daniel Vetter
On Tue, Jun 17, 2014 at 07:54:38AM +0100, Chris Wilson wrote: > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > +/** > > + * intel_frontbuffer_flush - flush frontbuffer > > + * @dev: DRM device > > + * @frontbuffer_bits: frontbuffer plane tracking bits > > + * > > + * This functi

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Chris Wilson
On Tue, Jun 17, 2014 at 08:40:10AM +0100, Chris Wilson wrote: > On Tue, Jun 17, 2014 at 09:37:35AM +0200, Daniel Vetter wrote: > > On Tue, Jun 17, 2014 at 07:50:45AM +0100, Chris Wilson wrote: > > > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > > > @@ -2227,6 +2223,9 @@ i915_ge

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Chris Wilson
On Tue, Jun 17, 2014 at 09:37:35AM +0200, Daniel Vetter wrote: > On Tue, Jun 17, 2014 at 07:50:45AM +0100, Chris Wilson wrote: > > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > > @@ -2227,6 +2223,9 @@ i915_gem_object_move_to_inactive(struct > > > drm_i915_gem_object *obj) > >

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Daniel Vetter
On Tue, Jun 17, 2014 at 07:52:25AM +0100, Chris Wilson wrote: > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > +static void intel_mark_fb_busy(struct drm_device *dev, > > + unsigned frontbuffer_bits, > > + struct intel_engine_cs

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Daniel Vetter
On Tue, Jun 17, 2014 at 07:50:45AM +0100, Chris Wilson wrote: > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > @@ -2227,6 +2223,9 @@ i915_gem_object_move_to_inactive(struct > > drm_i915_gem_object *obj) > > list_move_tail(&vma->mm_list, &vm->inactive_list);

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Daniel Vetter
On Tue, Jun 17, 2014 at 07:49:30AM +0100, Chris Wilson wrote: > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > @@ -3966,6 +3971,8 @@ i915_gem_object_set_to_cpu_domain(struct > > drm_i915_gem_object *obj, bool write) > > obj->base.write_domain = I915_GEM_DOMAIN_CPU;

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Chris Wilson
On Tue, Jun 17, 2014 at 09:32:47AM +0200, Daniel Vetter wrote: > On Tue, Jun 17, 2014 at 07:41:48AM +0100, Chris Wilson wrote: > > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > > diff --git a/drivers/gpu/drm/i915/intel_fbdev.c > > > b/drivers/gpu/drm/i915/intel_fbdev.c > > > i

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Daniel Vetter
On Tue, Jun 17, 2014 at 07:46:46AM +0100, Chris Wilson wrote: > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > void i915_gem_release(struct drm_device *dev, struct drm_file *file) > > diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c > > b/drivers/gpu/drm/i915/i915_gem_e

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Daniel Vetter
On Tue, Jun 17, 2014 at 07:41:48AM +0100, Chris Wilson wrote: > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > diff --git a/drivers/gpu/drm/i915/intel_fbdev.c > > b/drivers/gpu/drm/i915/intel_fbdev.c > > index 27975c3e21c5..12276c39d14d 100644 > > --- a/drivers/gpu/drm/i915/int

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-17 Thread Chris Wilson
On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > diff --git a/drivers/gpu/drm/i915/intel_display.c > b/drivers/gpu/drm/i915/intel_display.c > index b8359f4a6dc4..dfdbf2a02844 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -2755

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-16 Thread Chris Wilson
On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > +/** > + * intel_fb_flip_prepare - flip frontbuffer > + * @obj: GEM object to flush > + * > + * This function gets called after scheduling a flip on @obj. The actual > + * frontbuffer flushing will be delayed until completion is signa

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-16 Thread Chris Wilson
On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > +/** > + * intel_frontbuffer_flush - flush frontbuffer > + * @dev: DRM device > + * @frontbuffer_bits: frontbuffer plane tracking bits > + * > + * This function gets called every time rendering on the given planes has > + * completed

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-16 Thread Chris Wilson
On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > +static void intel_mark_fb_busy(struct drm_device *dev, > +unsigned frontbuffer_bits, > +struct intel_engine_cs *ring) > { > - struct drm_device *dev = obj->base.dev; >

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-16 Thread Chris Wilson
On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > @@ -2227,6 +2223,9 @@ i915_gem_object_move_to_inactive(struct > drm_i915_gem_object *obj) > list_move_tail(&vma->mm_list, &vm->inactive_list); > } > > + if (obj->frontbuffer_bits) > + int

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-16 Thread Chris Wilson
On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > @@ -3966,6 +3971,8 @@ i915_gem_object_set_to_cpu_domain(struct > drm_i915_gem_object *obj, bool write) > obj->base.write_domain = I915_GEM_DOMAIN_CPU; > } > /* We do not need to explicitly invalidate the fb when

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-16 Thread Chris Wilson
On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > void i915_gem_release(struct drm_device *dev, struct drm_file *file) > diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c > b/drivers/gpu/drm/i915/i915_gem_execbuffer.c > index 93d7f7246588..2d06aad4a954 100644 > --- a/drivers/

Re: [Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-16 Thread Chris Wilson
On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > diff --git a/drivers/gpu/drm/i915/intel_fbdev.c > b/drivers/gpu/drm/i915/intel_fbdev.c > index 27975c3e21c5..12276c39d14d 100644 > --- a/drivers/gpu/drm/i915/intel_fbdev.c > +++ b/drivers/gpu/drm/i915/intel_fbdev.c > @@ -43,10 +43,26

[Intel-gfx] [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing

2014-06-16 Thread Daniel Vetter
So these are the guts of the new beast. This tracks when a frontbuffer gets invalidated (due to frontbuffer rendering) and hence should be constantly scaned out, and when it's flushed again and can be compressed/one-shot-upload. Rules for flushing are simple: The frontbuffer needs one more full up