drm/i915: Make fb user dirty operation to invalidate frontbuffer
Subsystems (7)
Rodrigo Vivi
maintainerPATCH 1/4 drm/i915: Make fb user dirty operation to invalidate frontbuffer
This patch introduces a frontbuffer invalidation on dirty fb user callback.
It is mainly used for DIRTYFB drm ioctl, but can be extended for fbdev use on following patch.
This patch itself already solves the biggest PSR known issue, that is missed screen updates during boot, mainly when there is a splash screen involved like plymouth.
Plymoth will do a modeset over ioctl that flushes frontbuffer tracking and PSR gets back to work while it cannot track the screen updates and exit properly. However plymouth also uses a dirtyfb ioctl whenever updating the screen. So let's use it to invalidate PSR back again.
This patch also introduces the ORIGIN_FB_DIRTY to frontbuffer tracking. The reason is that whenever using this invalidate path we don't need to keep continuously invalidating the frontbuffer for every call. One call between flips is enough to keep frontbuffer tracking invalidated and let all users aware. If a sync or async flip completed it means that we probably can flush everything and enable powersavings features back. If this isn't the case on the next dirty call we invalidate it again until next flip.
--- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/intel_display.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/intel_frontbuffer.c | 18 ++++++++++++++++++ 3 files changed, 38 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -889,6 +889,7 @@ enum fb_op_origin {ORIGIN_CPU ,ORIGIN_CS ,ORIGIN_FLIP , + ORIGIN_FB_DIRTY, }; struct i915_fbc {
@@ -1628,6 +1629,7 @@ struct i915_frontbuffer_tracking {*/ unsigned busy_bits;unsigned flip_bits; +bool fb_dirty; };struct i915_wa_reg {
drivers/gpu/drm/i915/intel_display.c +18 -0
@@ -14330,9 +14330,27 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,return drm_gem_handle_create (file, &obj->base, handle); } +static int intel_user_framebuffer_dirty (struct drm_framebuffer *fb, +struct drm_file *file, +unsigned flags,unsigned color, +struct drm_clip_rect *clips, +unsigned num_clips) +{ +struct drm_device *dev = fb->dev; +struct intel_framebuffer *intel_fb =to_intel_framebuffer (fb); +struct drm_i915_gem_object *obj = intel_fb->obj; + +mutex_lock (&dev->struct_mutex); +intel_fb_obj_invalidate (obj,ORIGIN_FB_DIRTY ); +mutex_unlock (&dev->struct_mutex); + +return 0 ; +} +static const struct drm_framebuffer_funcs intel_fb_funcs = { .destroy = intel_user_framebuffer_destroy, .create_handle = intel_user_framebuffer_create_handle, + .dirty = intel_user_framebuffer_dirty, }; static
drivers/gpu/drm/i915/intel_frontbuffer.c +18 -0
@@ -81,12 +81,28 @@ void intel_fb_obj_invalidate(struct drm_i915_gem_object *obj, {struct drm_device *dev = obj->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev); +bool fb_dirty;WARN_ON (!mutex_is_locked (&dev->struct_mutex));if (!obj->frontbuffer_bits)return ; +/* +* We just invalidate the frontbuffer on the first dirty and keep +* it dirty and invalid until next flip. +*/ +if (origin ==ORIGIN_FB_DIRTY ) { +mutex_lock (&dev_priv->fb_tracking.lock); + fb_dirty = dev_priv->fb_tracking.fb_dirty; + dev_priv->fb_tracking.fb_dirty = true; +mutex_unlock (&dev_priv->fb_tracking.lock); + +if (fb_dirty) +return ; +DRM_ERROR ("PSR FBT invalidate dirty\n" ); + } +if (origin ==ORIGIN_CS ) {mutex_lock (&dev_priv->fb_tracking.lock); dev_priv->fb_tracking.busy_bits
@@ -207,6 +223,7 @@ void intel_frontbuffer_flip_complete(struct drm_device *dev,struct drm_i915_private *dev_priv =to_i915 (dev);mutex_lock (&dev_priv->fb_tracking.lock); + dev_priv->fb_tracking.fb_dirty = false;/* Mask any cancelled flips. */ frontbuffer_bits &= dev_priv->fb_tracking.flip_bits; dev_priv->fb_tracking.flip_bits &= ~frontbuffer_bits;
@@ -233,6 +250,7 @@ void intel_frontbuffer_flip(struct drm_device *dev,struct drm_i915_private *dev_priv =to_i915 (dev);mutex_lock (&dev_priv->fb_tracking.lock); + dev_priv->fb_tracking.fb_dirty = false;/* Remove stale busy bits due to the old buffer. */ dev_priv->fb_tracking.busy_bits &= ~frontbuffer_bits;mutex_unlock (&dev_priv->fb_tracking.lock);
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Rodrigo Vivi
maintainerPATCH 2/4 fbdev: Introduce fb_dirty operation.
There are cases we need to mark dirty/damaged areas, specially with operations that touches frontbuffer directly. To cover these cases this patch introduces the optional fb_dirty operation.
--- drivers/video/fbdev/core/cfbcopyarea.c | 3 +++ drivers/video/fbdev/core/cfbfillrect.c | 3 +++ drivers/video/fbdev/core/cfbimgblt.c | 4 ++++ drivers/video/fbdev/core/syscopyarea.c | 3 +++ drivers/video/fbdev/core/sysfillrect.c | 3 +++ drivers/video/fbdev/core/sysimgblt.c | 4 ++++ include/linux/fb.h | 3 +++ 7 files changed, 23 insertions(+)
drivers/video/fbdev/core/cfbcopyarea.c +3 -0
@@ -427,6 +427,9 @@ void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) src_idx += bits_per_line; } } + +if (p->fbops->fb_dirty) + p->fbops->fb_dirty (p, dx, dy, width, height); }EXPORT_SYMBOL (cfb_copyarea);
drivers/video/fbdev/core/cfbfillrect.c +3 -0
@@ -362,6 +362,9 @@ void cfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect) dst_idx += p->fix.line_length*8 ; } } + +if (p->fbops->fb_dirty) + p->fbops->fb_dirty (p, rect->dx, rect->dy, width, height); }EXPORT_SYMBOL (cfb_fillrect);
drivers/video/fbdev/core/cfbimgblt.c +4 -0
@@ -267,6 +267,7 @@ void cfb_imageblit(struct fb_info *p, const struct fb_image *image)u32 fgcolor, bgcolor, start_index, bitstart, pitch_index =0 ;u32 bpl =sizeof (u32), bpp = p->var.bits_per_pixel;u32 width = image->width; +u32 height = image->height;u32 dx = image->dx, dy = image->dy;u8 __iomem *dst1;
@@ -303,6 +304,9 @@ void cfb_imageblit(struct fb_info *p, const struct fb_image *image) start_index, pitch_index); }else color_imageblit (image, p, dst1, start_index, pitch_index); + +if (p->fbops->fb_dirty) + p->fbops->fb_dirty (p, dx, dy, width, height); }EXPORT_SYMBOL (cfb_imageblit);
drivers/video/fbdev/core/syscopyarea.c +3 -0
@@ -360,6 +360,9 @@ void sys_copyarea(struct fb_info *p, const struct fb_copyarea *area) src_idx += bits_per_line; } } + +if (p->fbops->fb_dirty) + p->fbops->fb_dirty (p, dx, dy, width, height); }EXPORT_SYMBOL (sys_copyarea);
drivers/video/fbdev/core/sysfillrect.c +3 -0
@@ -326,6 +326,9 @@ void sys_fillrect(struct fb_info *p, const struct fb_fillrect *rect) dst_idx += p->fix.line_length*8 ; } } + +if (p->fbops->fb_dirty) + p->fbops->fb_dirty (p, rect->dx, rect->dy, width, height); }EXPORT_SYMBOL (sys_fillrect);
drivers/video/fbdev/core/sysimgblt.c +4 -0
@@ -243,6 +243,7 @@ void sys_imageblit(struct fb_info *p, const struct fb_image *image)u32 bpl =sizeof (u32), bpp = p->var.bits_per_pixel;u32 width = image->width;u32 dx = image->dx, dy = image->dy; +u32 height = image->height;void *dst1;if (p->state !=FBINFO_STATE_RUNNING )
@@ -278,6 +279,9 @@ void sys_imageblit(struct fb_info *p, const struct fb_image *image) start_index, pitch_index); }else color_imageblit (image, p, dst1, start_index, pitch_index); + +if (p->fbops->fb_dirty) + p->fbops->fb_dirty (p, dx, dy, width, height); }EXPORT_SYMBOL (sys_imageblit);
include/linux/fb.h +3 -0
@@ -284,6 +284,9 @@ struct fb_ops {/* wait for blit idle, optional */ int (*fb_sync)(struct fb_info *info); +/* Mark rect as dirty (optional) */ +void (*fb_dirty)(struct fb_info *info,u32 x1,u32 y1,u32 x2,u32 y2); +/* perform fb specific ioctl (optional) */ int (*fb_ioctl)(struct fb_info *info,unsigned int cmd,unsigned long arg);
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/4] fbdev: Introduce fb_dirty operation.
Quoted 5 lines · Rodrigo Vivi
There are cases we need to mark dirty/damaged areas, specially with operations that touches frontbuffer directly. To cover these cases this patch introduces the optional
fb_dirtyoperation.Signed-off-by Rodrigo Vivi <[email protected]>
The problem is that drm ->dirty() hook must be called from process context, and iirc some of these callbacks can be called from softirq context (for cursor updates).
Since this is a special drm requirement I think it'd be better to implement this in the drm fbdev emulation (by wrapping the various cfb_* functions). We'd also need to do the actual ->dirty() call in an async worker. And that needs to check whether fbdev is still in charge or whether the work item raced with a kms client.
For the async worker you can look into qxl_fb.c. Essentially you could copy all these functions into drm_fb_helper.c, give them suitable prefixes and in qxl_fb_work instead of calling qxl_fb_dirty_flush directly we'd call ->dirty() on the fbdev fb through the generic vfunc hook.
That one is already implement and hooked up as qxl_framebuffer_surface_dirty. We don't even need to grab any locks in the worker since the normal DIRTYFB ioctl is also lockless. -Daniel
Quoted 131 lines
--- drivers/video/fbdev/core/cfbcopyarea.c | 3 +++ drivers/video/fbdev/core/cfbfillrect.c | 3 +++ drivers/video/fbdev/core/cfbimgblt.c | 4 ++++ drivers/video/fbdev/core/syscopyarea.c | 3 +++ drivers/video/fbdev/core/sysfillrect.c | 3 +++ drivers/video/fbdev/core/sysimgblt.c | 4 ++++ include/linux/fb.h | 3 +++ 7 files changed, 23 insertions(+)drivers/video/fbdev/core/cfbcopyarea.c +3
-0@@ -427,6 +427,9 @@ void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) src_idx += bits_per_line; } } + +if (p->fbops->fb_dirty) + p->fbops->fb_dirty (p, dx, dy, width, height); }EXPORT_SYMBOL (cfb_copyarea);drivers/video/fbdev/core/cfbfillrect.c +3
-0@@ -362,6 +362,9 @@ void cfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect) dst_idx += p->fix.line_length*8 ; } } + +if (p->fbops->fb_dirty) + p->fbops->fb_dirty (p, rect->dx, rect->dy, width, height); }EXPORT_SYMBOL (cfb_fillrect);drivers/video/fbdev/core/cfbimgblt.c +4
-0@@ -267,6 +267,7 @@ void cfb_imageblit(struct fb_info *p, const struct fb_image *image)u32 fgcolor, bgcolor, start_index, bitstart, pitch_index =0 ;u32 bpl =sizeof (u32), bpp = p->var.bits_per_pixel;u32 width = image->width; +u32 height = image->height;u32 dx = image->dx, dy = image->dy;u8 __iomem *dst1;@@ -303,6 +304,9 @@ void cfb_imageblit(struct fb_info *p, const struct fb_image *image) start_index, pitch_index); }else color_imageblit (image, p, dst1, start_index, pitch_index); + +if (p->fbops->fb_dirty) + p->fbops->fb_dirty (p, dx, dy, width, height); }EXPORT_SYMBOL (cfb_imageblit);drivers/video/fbdev/core/syscopyarea.c +3
-0@@ -360,6 +360,9 @@ void sys_copyarea(struct fb_info *p, const struct fb_copyarea *area) src_idx += bits_per_line; } } + +if (p->fbops->fb_dirty) + p->fbops->fb_dirty (p, dx, dy, width, height); }EXPORT_SYMBOL (sys_copyarea);drivers/video/fbdev/core/sysfillrect.c +3
-0@@ -326,6 +326,9 @@ void sys_fillrect(struct fb_info *p, const struct fb_fillrect *rect) dst_idx += p->fix.line_length*8 ; } } + +if (p->fbops->fb_dirty) + p->fbops->fb_dirty (p, rect->dx, rect->dy, width, height); }EXPORT_SYMBOL (sys_fillrect);drivers/video/fbdev/core/sysimgblt.c +4
-0@@ -243,6 +243,7 @@ void sys_imageblit(struct fb_info *p, const struct fb_image *image)u32 bpl =sizeof (u32), bpp = p->var.bits_per_pixel;u32 width = image->width;u32 dx = image->dx, dy = image->dy; +u32 height = image->height;void *dst1;if (p->state !=FBINFO_STATE_RUNNING )@@ -278,6 +279,9 @@ void sys_imageblit(struct fb_info *p, const struct fb_image *image) start_index, pitch_index); }else color_imageblit (image, p, dst1, start_index, pitch_index); + +if (p->fbops->fb_dirty) + p->fbops->fb_dirty (p, dx, dy, width, height); }EXPORT_SYMBOL (sys_imageblit);include/linux/fb.h +3
-0@@ -284,6 +284,9 @@ struct fb_ops {/* wait for blit idle, optional */ int (*fb_sync)(struct fb_info *info); +/* Mark rect as dirty (optional) */ +void (*fb_dirty)(struct fb_info *info,u32 x1,u32 y1,u32 x2,u32 y2); +/* perform fb specific ioctl (optional) */ int (*fb_ioctl)(struct fb_info *info,unsigned int cmd,unsigned long arg);Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Rodrigo Vivi
maintainerPATCH 3/4 drm/udl: Use fb_dirty ops to simplify damage calls
In reply to Rodrigo ViviWith fb_dirty op in place we can simplify stuff here.
--- drivers/gpu/drm/udl/udl_fb.c | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-)
drivers/gpu/drm/udl/udl_fb.c +6 -28
@@ -284,34 +284,11 @@ static int udl_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)return 0 ; } -static void udl_fb_fillrect (struct fb_info *info,const struct fb_fillrect *rect) +static void udl_fb_dirty (struct fb_info *info,u32 x1,u32 y1,u32 x2,u32 y2) {struct udl_fbdev *ufbdev = info->par; -sys_fillrect (info, rect); - -udl_handle_damage (&ufbdev->ufb, rect->dx, rect->dy, rect->width, - rect->height); -} - -static void udl_fb_copyarea (struct fb_info *info,const struct fb_copyarea *region) -{ -struct udl_fbdev *ufbdev = info->par; - -sys_copyarea (info, region); - -udl_handle_damage (&ufbdev->ufb, region->dx, region->dy, region->width, - region->height); -} - -static void udl_fb_imageblit (struct fb_info *info,const struct fb_image *image) -{ -struct udl_fbdev *ufbdev = info->par; - -sys_imageblit (info, image); - -udl_handle_damage (&ufbdev->ufb, image->dx, image->dy, image->width, - image->height); +udl_handle_damage (&ufbdev->ufb, x1, y1, x2, y2); }/*
@@ -380,9 +357,10 @@ static struct fb_ops udlfb_ops = { .owner = THIS_MODULE, .fb_check_var = drm_fb_helper_check_var, .fb_set_par = drm_fb_helper_set_par, - .fb_fillrect = udl_fb_fillrect, - .fb_copyarea = udl_fb_copyarea, - .fb_imageblit = udl_fb_imageblit, + .fb_fillrect = sys_fillrect, + .fb_copyarea = sys_copyarea, + .fb_imageblit = sys_imageblit, + .fb_dirty = udl_fb_dirty, .fb_pan_display = drm_fb_helper_pan_display, .fb_blank = drm_fb_helper_blank, .fb_setcmap = drm_fb_helper_setcmap,
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Rodrigo Vivi
maintainerPATCH 4/4 drm/i915: fbdev dirty calls fb user dirty to invalidate frontbuffer.
In reply to Rodrigo ViviNow that we have fb user dirty invalidating frontbuffer and we have the new fbdev dirty callback let's merge them.
So it doesn't matter if fbcon throught fbdev or splash screen throught drm_ioctl_dirtyfb, in any case we will have frontbuffer properly invalidated and power savings features that rely on frontbuffer tracking will be able to work as expected.
--- drivers/gpu/drm/i915/intel_fbdev.c | 86 ++++++-------------------------------- 1 file changed, 13 insertions(+), 73 deletions(-)
drivers/gpu/drm/i915/intel_fbdev.c +13 -73
@@ -45,92 +45,32 @@#include <drm/i915_drm.h> #include "i915_drv.h" -static int intel_fbdev_set_par (struct fb_info *info) +static void intel_fbdev_dirty (struct fb_info *info,u32 x1,u32 y1, +u32 x2,u32 y2) {struct drm_fb_helper *fb_helper = info->par;struct intel_fbdev *ifbdev = container_of(fb_helper, struct intel_fbdev, helper); -int ret; - - ret =drm_fb_helper_set_par (info); - -if (ret ==0 ) { -/* -* FIXME: fbdev presumes that all callbacks also work from -* atomic contexts and relies on that for emergency oops -* printing. KMS totally doesn't do that and the locking here is -* by far not the only place this goes wrong. Ignore this for -* now until we solve this for real. -*/ -mutex_lock (&fb_helper->dev->struct_mutex); - ret =i915_gem_object_set_to_gtt_domain (ifbdev->fb->obj, - true); -mutex_unlock (&fb_helper->dev->struct_mutex); - } - -return ret; -} - -static int intel_fbdev_blank (int blank,struct fb_info *info) -{ -struct drm_fb_helper *fb_helper = info->par; -struct intel_fbdev *ifbdev = - container_of(fb_helper, struct intel_fbdev, helper); -int ret; - - ret =drm_fb_helper_blank (blank, info); - -if (ret ==0 ) { -/* -* FIXME: fbdev presumes that all callbacks also work from -* atomic contexts and relies on that for emergency oops -* printing. KMS totally doesn't do that and the locking here is -* by far not the only place this goes wrong. Ignore this for -* now until we solve this for real. -*/ -mutex_lock (&fb_helper->dev->struct_mutex); -intel_fb_obj_invalidate (ifbdev->fb->obj,ORIGIN_GTT ); -mutex_unlock (&fb_helper->dev->struct_mutex); - } - -return ret; -} - -static int intel_fbdev_pan_display (struct fb_var_screeninfo *var, -struct fb_info *info) -{ -struct drm_fb_helper *fb_helper = info->par; -struct intel_fbdev *ifbdev = - container_of(fb_helper, struct intel_fbdev, helper); - -int ret; - ret =drm_fb_helper_pan_display (var, info); - -if (ret ==0 ) { -/* -* FIXME: fbdev presumes that all callbacks also work from -* atomic contexts and relies on that for emergency oops -* printing. KMS totally doesn't do that and the locking here is -* by far not the only place this goes wrong. Ignore this for -* now until we solve this for real. -*/ -mutex_lock (&fb_helper->dev->struct_mutex); -intel_fb_obj_invalidate (ifbdev->fb->obj,ORIGIN_GTT ); -mutex_unlock (&fb_helper->dev->struct_mutex); - } +struct intel_framebuffer *intel_fb = ifbdev->fb; +struct drm_framebuffer *fb = &intel_fb->base; -return ret; +/* +* Our fb dirty callback is just used to invalidate frontbuffer +* entirely. So just fb reference is needed and rest is ignored. +*/ + fb->funcs->dirty (fb,NULL ,0 ,0 ,NULL ,1 ); }static struct fb_ops intelfb_ops = { .owner =THIS_MODULE , .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = intel_fbdev_set_par, + .fb_set_par = drm_fb_helper_set_par, .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_pan_display = intel_fbdev_pan_display, - .fb_blank = intel_fbdev_blank, + .fb_dirty = intel_fbdev_dirty, + .fb_pan_display = drm_fb_helper_pan_display, + .fb_blank = drm_fb_helper_blank, .fb_setcmap = drm_fb_helper_setcmap, .fb_debug_enter = drm_fb_helper_debug_enter, .fb_debug_leave = drm_fb_helper_debug_leave,
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 4/4] drm/i915: fbdev dirty calls fb user dirty to invalidate frontbuffer.
Quoted 9 lines · Rodrigo Vivi
Now that we have fb user dirty invalidating frontbuffer and we have the new fbdev dirty callback let's merge them.
So it doesn't matter if fbcon throught fbdev or splash screen throught
drm_ioctl_dirtyfb, in any case we will have frontbuffer properly invalidated and power savings features that rely on frontbuffer tracking will be able to work as expected.Signed-off-by Rodrigo Vivi <[email protected]>
Hm, I think we still need these but not sure. There's also fbdev client from userspace which directly draw into the mmap area. But tbh no idea how those are supposed to work with manually updating screens (like i915 psr, udl or qxl).
-Daniel
Quoted 121 lines
--- drivers/gpu/drm/i915/intel_fbdev.c | 86 ++++++-------------------------------- 1 file changed, 13 insertions(+), 73 deletions(-)drivers/gpu/drm/i915/intel_fbdev.c +13
-73@@ -45,92 +45,32 @@#include <drm/i915_drm.h> #include "i915_drv.h" -static int intel_fbdev_set_par (struct fb_info *info) +static void intel_fbdev_dirty (struct fb_info *info,u32 x1,u32 y1, +u32 x2,u32 y2) {struct drm_fb_helper *fb_helper = info->par;struct intel_fbdev *ifbdev = container_of(fb_helper, struct intel_fbdev, helper); -int ret; - - ret =drm_fb_helper_set_par (info); - -if (ret ==0 ) { -/* -* FIXME: fbdev presumes that all callbacks also work from -* atomic contexts and relies on that for emergency oops -* printing. KMS totally doesn't do that and the locking here is -* by far not the only place this goes wrong. Ignore this for -* now until we solve this for real. -*/ -mutex_lock (&fb_helper->dev->struct_mutex); - ret =i915_gem_object_set_to_gtt_domain (ifbdev->fb->obj, - true); -mutex_unlock (&fb_helper->dev->struct_mutex); - } - -return ret; -} - -static int intel_fbdev_blank (int blank,struct fb_info *info) -{ -struct drm_fb_helper *fb_helper = info->par; -struct intel_fbdev *ifbdev = - container_of(fb_helper, struct intel_fbdev, helper); -int ret; - - ret =drm_fb_helper_blank (blank, info); - -if (ret ==0 ) { -/* -* FIXME: fbdev presumes that all callbacks also work from -* atomic contexts and relies on that for emergency oops -* printing. KMS totally doesn't do that and the locking here is -* by far not the only place this goes wrong. Ignore this for -* now until we solve this for real. -*/ -mutex_lock (&fb_helper->dev->struct_mutex); -intel_fb_obj_invalidate (ifbdev->fb->obj,ORIGIN_GTT ); -mutex_unlock (&fb_helper->dev->struct_mutex); - } - -return ret; -} - -static int intel_fbdev_pan_display (struct fb_var_screeninfo *var, -struct fb_info *info) -{ -struct drm_fb_helper *fb_helper = info->par; -struct intel_fbdev *ifbdev = - container_of(fb_helper, struct intel_fbdev, helper); - -int ret; - ret =drm_fb_helper_pan_display (var, info); - -if (ret ==0 ) { -/* -* FIXME: fbdev presumes that all callbacks also work from -* atomic contexts and relies on that for emergency oops -* printing. KMS totally doesn't do that and the locking here is -* by far not the only place this goes wrong. Ignore this for -* now until we solve this for real. -*/ -mutex_lock (&fb_helper->dev->struct_mutex); -intel_fb_obj_invalidate (ifbdev->fb->obj,ORIGIN_GTT ); -mutex_unlock (&fb_helper->dev->struct_mutex); - } +struct intel_framebuffer *intel_fb = ifbdev->fb; +struct drm_framebuffer *fb = &intel_fb->base; -return ret; +/* +* Our fb dirty callback is just used to invalidate frontbuffer +* entirely. So just fb reference is needed and rest is ignored. +*/ + fb->funcs->dirty (fb,NULL ,0 ,0 ,NULL ,1 ); }static struct fb_ops intelfb_ops = { .owner =THIS_MODULE , .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = intel_fbdev_set_par, + .fb_set_par = drm_fb_helper_set_par, .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_pan_display = intel_fbdev_pan_display, - .fb_blank = intel_fbdev_blank, + .fb_dirty = intel_fbdev_dirty, + .fb_pan_display = drm_fb_helper_pan_display, + .fb_blank = drm_fb_helper_blank, .fb_setcmap = drm_fb_helper_setcmap, .fb_debug_enter = drm_fb_helper_debug_enter, .fb_debug_leave = drm_fb_helper_debug_leave,Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH 4/4] drm/i915: fbdev dirty calls fb user dirty to invalidate frontbuffer.
Quoted 9 lines · Daniel Vetter
Quoted 8 lines · Rodrigo Vivi
Now that we have fb user dirty invalidating frontbuffer and we have the new fbdev dirty callback let's merge them.
So it doesn't matter if fbcon throught fbdev or splash screen throught
drm_ioctl_dirtyfb, in any case we will have frontbuffer properly invalidated and power savings features that rely on frontbuffer tracking will be able to work as expected.
Quoted 7 lines
Quoted 1 line
Signed-off-by Rodrigo Vivi <[email protected]>Hm, I think we still need these but not sure. There's also fbdev client from userspace which directly draw into the mmap area. But tbh no idea how those are supposed to work with manually updating screens (like i915 psr, udl or qxl).
Oh! Agree... I got the issue after blank so we still need those...
Let's forget about these fbdev changes and focus on a simple fb user dirty ops that fix the current real remaining issue...
Quoted 132 lines
-Daniel
Quoted 2 lines
--- drivers/gpu/drm/i915/intel_fbdev.c | 86++++++--------------------------------
Review
Quoted 3 lines
1 file changed, 13 insertions(+), 73 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_fbdev.cQuoted 13 lines
index 2a1724e..f1592c7 100644
drivers/gpu/drm/i915/intel_fbdev.c +2
-1@@ -45,92 +45,32 @@#include <drm/i915_drm.h> #include "i915_drv.h" -static int intel_fbdev_set_par (struct fb_info *info) +static void intel_fbdev_dirty (struct fb_info *info,u32 x1,u32 y1, +u32 x2,u32 y2) {struct drm_fb_helper *fb_helper = info->par; struct intel_fbdev *ifbdev =drivers/gpu/drm/i915/intel_fbdev.c line 61
Quoted 10 lines
drivers/gpu/drm/i915/intel_fbdev.c +0
-9container_of(fb_helper, struct intel_fbdev, helper); -int ret; - - ret =drm_fb_helper_set_par (info); - -if (ret ==0 ) { -/* -* FIXME: fbdev presumes that all callbacks also work from -* atomic contexts and relies on that for emergency oops -* printing. KMS totally doesn't do that and the locking here is
drivers/gpu/drm/i915/intel_fbdev.c line 62
Quoted 1 line
drivers/gpu/drm/i915/intel_fbdev.c +0
-1-* by far not the only place this goes wrong. Ignore this for
Quoted 15 lines
drivers/gpu/drm/i915/intel_fbdev.c +0
-15-* now until we solve this for real. -*/ -mutex_lock (&fb_helper->dev->struct_mutex); - ret =i915_gem_object_set_to_gtt_domain (ifbdev->fb->obj, - true); -mutex_unlock (&fb_helper->dev->struct_mutex); - } - -return ret; -} - -static int intel_fbdev_blank (int blank,struct fb_info *info) -{ -struct drm_fb_helper *fb_helper = info->par; - struct intel_fbdev *ifbdev =drivers/gpu/drm/i915/intel_fbdev.c
Quoted 10 lines
drivers/gpu/drm/i915/intel_fbdev.c +0
-10- container_of(fb_helper, struct intel_fbdev, helper); -int ret; - - ret =drm_fb_helper_blank (blank, info); - -if (ret ==0 ) { -/* -* FIXME: fbdev presumes that all callbacks also work from -* atomic contexts and relies on that for emergency oops -* printing. KMS totally doesn't do that and the locking here is
drivers/gpu/drm/i915/intel_fbdev.c line 88
Quoted 1 line
drivers/gpu/drm/i915/intel_fbdev.c +0
-1-* by far not the only place this goes wrong. Ignore this for
Quoted 15 lines
drivers/gpu/drm/i915/intel_fbdev.c +0
-15-* now until we solve this for real. -*/ -mutex_lock (&fb_helper->dev->struct_mutex); -intel_fb_obj_invalidate (ifbdev->fb->obj,ORIGIN_GTT ); -mutex_unlock (&fb_helper->dev->struct_mutex); - } - -return ret; -} - -static int intel_fbdev_pan_display (struct fb_var_screeninfo *var, -struct fb_info *info) -{ -struct drm_fb_helper *fb_helper = info->par; - struct intel_fbdev *ifbdev =drivers/gpu/drm/i915/intel_fbdev.c
Quoted 10 lines
drivers/gpu/drm/i915/intel_fbdev.c +0
-10- container_of(fb_helper, struct intel_fbdev, helper); - -int ret; - ret =drm_fb_helper_pan_display (var, info); - -if (ret ==0 ) { -/* -* FIXME: fbdev presumes that all callbacks also work from -* atomic contexts and relies on that for emergency oops -* printing. KMS totally doesn't do that and the locking here is
drivers/gpu/drm/i915/intel_fbdev.c line 114
Quoted 1 line
drivers/gpu/drm/i915/intel_fbdev.c +0
-1-* by far not the only place this goes wrong. Ignore this for
Quoted 36 lines
drivers/gpu/drm/i915/intel_fbdev.c +11
-11-* now until we solve this for real. -*/ -mutex_lock (&fb_helper->dev->struct_mutex); -intel_fb_obj_invalidate (ifbdev->fb->obj,ORIGIN_GTT ); -mutex_unlock (&fb_helper->dev->struct_mutex); - } +struct intel_framebuffer *intel_fb = ifbdev->fb; +struct drm_framebuffer *fb = &intel_fb->base; -return ret; +/* +* Our fb dirty callback is just used to invalidate frontbuffer +* entirely. So just fb reference is needed and rest is ignored. +*/ + fb->funcs->dirty (fb,NULL ,0 ,0 ,NULL ,1 ); }static struct fb_ops intelfb_ops = { .owner =THIS_MODULE , .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = intel_fbdev_set_par, + .fb_set_par = drm_fb_helper_set_par, .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_pan_display = intel_fbdev_pan_display, - .fb_blank = intel_fbdev_blank, + .fb_dirty = intel_fbdev_dirty, + .fb_pan_display = drm_fb_helper_pan_display, + .fb_blank = drm_fb_helper_blank, .fb_setcmap = drm_fb_helper_setcmap, .fb_debug_enter = drm_fb_helper_debug_enter, .fb_debug_leave = drm_fb_helper_debug_leave, --2.1.0
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 9 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 4/4] drm/i915: fbdev dirty calls fb user dirty to invalidate frontbuffer.
In reply to Rodrigo ViviTask id: 6671 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
ILK -26 302/302 276/302 SNB -40 312/316 272/316 IVB -22 343/343 321/343 BYT -10 287/287 277/287
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*ILK igt@drv_suspend@debugfs-reader PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@drv_suspend@fence-restore-tiled2untiled PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@drv_suspend@fence-restore-untiled PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@drv_suspend@forcewake PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@gem_close_race@process-exit PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@gem_fence_thrash@bo-write-verify-threaded-none PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@gem_persistent_relocs@forked-thrashing PASS(1) TIMEOUT(1) *ILK igt@gem_reloc_vs_gpu@forked-interruptible-thrashing PASS(1) TIMEOUT(1) *ILK igt@gem_reset_stats@params PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@gem_seqno_wrap PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@gem_workarounds@suspend-resume PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_flip@blocking-absolute-wf_vblank-interruptible PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_flip@flip-vs-dpms-interruptible PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_flip@flip-vs-rmfb-interruptible PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_pch_fifo_underrun_irq_handler[i915]]*ERROR*PCH_transcoder_A_FIFO_underrun@PCH transcoder A FIFO underrun drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_flip@nonblocking-read PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_flip@nonexisting-fb PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_flip@rcs-wf_vblank-vs-dpms-interruptible PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_flip@vblank-vs-hang PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_flip@wf_vblank-ts-check PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_flip@wf_vblank-vs-modeset-interruptible PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_pipe_crc_basic@bad-nb-words-1 PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_pipe_crc_basic@bad-nb-words-3 PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_pipe_crc_basic@bad-pipe PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_pipe_crc_basic@bad-source PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_render@direct-render PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*ILK igt@kms_setmode@invalid-clone-exclusive-crtc PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@drm_vma_limiter PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@gem_close_race@process-exit PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_cursor_crc@cursor-size-change PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip@bo-too-big PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip@bo-too-big-interruptible PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip@dpms-vs-vblank-race PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip@dpms-vs-vblank-race-interruptible PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip_event_leak PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip@flip-vs-dpms-off-vs-modeset PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip@flip-vs-dpms-off-vs-modeset-interruptible PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip@modeset-vs-vblank-race PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip@modeset-vs-vblank-race-interruptible PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip@nonexisting-fb PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip@nonexisting-fb-interruptible PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip@single-buffer-flip-vs-dpms-off-vs-modeset PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip@single-buffer-flip-vs-dpms-off-vs-modeset-interruptible PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_flip_tiling@flip-changes-tiling PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_mmio_vs_cs_flip@setcrtc_vs_cs_flip PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_mmio_vs_cs_flip@setplane_vs_cs_flip PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_pipe_crc_basic@bad-nb-words-1 PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_pipe_crc_basic@bad-nb-words-3 PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_pipe_crc_basic@bad-pipe PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_pipe_crc_basic@bad-source PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@kms_setmode@invalid-clone-exclusive-crtc PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@cursor PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@cursor-dpms FAIL(1) DMESG_FAIL(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@debugfs-forcewake-user PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@dpms-mode-unset-non-lpsp FAIL(1) DMESG_FAIL(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@dpms-non-lpsp FAIL(1) DMESG_FAIL(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@drm-resources-equal PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@fences PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@fences-dpms FAIL(1) DMESG_FAIL(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@gem-execbuf PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@gem-idle PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@gem-mmap-cpu PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@gem-mmap-gtt PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@gem-pread PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@i2c PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@modeset-non-lpsp PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@modeset-non-lpsp-stress-no-wait PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@pci-d3-state PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@reg-read-ioctl PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rpm@rte PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*SNB igt@pm_rps@min-max-config-loaded PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@drm_vma_limiter PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@drm_vma_limiter_gtt PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_cursor_crc@cursor-128x128-onscreen PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_cursor_crc@cursor-128x128-random PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_cursor_crc@cursor-128x128-sliding PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_cursor_crc@cursor-256x256-offscreen PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_cursor_crc@cursor-256x256-onscreen PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_cursor_crc@cursor-256x256-sliding PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_cursor_crc@cursor-64x64-offscreen PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_cursor_crc@cursor-64x64-onscreen PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_cursor_crc@cursor-64x64-random PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_cursor_crc@cursor-64x64-sliding PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_cursor_crc@cursor-size-change PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_fence_pin_leak PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_mmio_vs_cs_flip@setcrtc_vs_cs_flip PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_mmio_vs_cs_flip@setplane_vs_cs_flip PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_pipe_crc_basic@bad-nb-words-1 PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_pipe_crc_basic@bad-nb-words-3 PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_pipe_crc_basic@bad-pipe PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_pipe_crc_basic@bad-source PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@kms_setmode@invalid-clone-exclusive-crtc PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*IVB igt@pm_rps@min-max-config-loaded PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*BYT igt@drm_vma_limiter PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*BYT igt@drm_vma_limiter_cpu PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*BYT igt@drm_vma_limiter_gtt PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*BYT igt@gem_basic@create-close PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*BYT igt@gem_close_race@process-exit PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*BYT igt@gem_partial_pwrite_pread@reads PASS(1) FAIL(1) *BYT igt@gem_partial_pwrite_pread@reads-uncached PASS(1) FAIL(1) *BYT igt@kms_setmode@clone-exclusive-crtc PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*BYT igt@kms_setmode@clone-single-crtc PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
*BYT igt@kms_setmode@invalid-clone-exclusive-crtc PASS(1) DMESG_WARN(1)
(dmesg patch applied)drm:intel_fb_obj_invalidate[i915]]*ERROR*PSR_FBT_invalidate_dirty@PSR FBT invalidate dirty
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Rodrigo Vivi
maintainerPATCH 1/1 drm/i915: fbdev dirty calls fb user dirty to invalidate frontbuffer.
In reply to Rodrigo ViviNow that we have fb user dirty invalidating frontbuffer and we have the new fbdev dirty callback let's merge them.
So it doesn't matter if fbcon throught fbdev or splash screen throught drm_ioctl_dirtyfb, in any case we will have frontbuffer properly invalidated and power savings features that rely on frontbuffer tracking will be able to work as expected.
v2: removing debug message that I had forgotten to remove.
--- drivers/gpu/drm/i915/intel_fbdev.c | 86 +++++--------------------------- drivers/gpu/drm/i915/intel_frontbuffer.c | 1 - 2 files changed, 13 insertions(+), 74 deletions(-)
drivers/gpu/drm/i915/intel_fbdev.c +13 -73
@@ -45,92 +45,32 @@#include <drm/i915_drm.h> #include "i915_drv.h" -static int intel_fbdev_set_par (struct fb_info *info) +static void intel_fbdev_dirty (struct fb_info *info,u32 x1,u32 y1, +u32 x2,u32 y2) {struct drm_fb_helper *fb_helper = info->par;struct intel_fbdev *ifbdev = container_of(fb_helper, struct intel_fbdev, helper); -int ret; - - ret =drm_fb_helper_set_par (info); - -if (ret ==0 ) { -/* -* FIXME: fbdev presumes that all callbacks also work from -* atomic contexts and relies on that for emergency oops -* printing. KMS totally doesn't do that and the locking here is -* by far not the only place this goes wrong. Ignore this for -* now until we solve this for real. -*/ -mutex_lock (&fb_helper->dev->struct_mutex); - ret =i915_gem_object_set_to_gtt_domain (ifbdev->fb->obj, - true); -mutex_unlock (&fb_helper->dev->struct_mutex); - } - -return ret; -} - -static int intel_fbdev_blank (int blank,struct fb_info *info) -{ -struct drm_fb_helper *fb_helper = info->par; -struct intel_fbdev *ifbdev = - container_of(fb_helper, struct intel_fbdev, helper); -int ret; - - ret =drm_fb_helper_blank (blank, info); - -if (ret ==0 ) { -/* -* FIXME: fbdev presumes that all callbacks also work from -* atomic contexts and relies on that for emergency oops -* printing. KMS totally doesn't do that and the locking here is -* by far not the only place this goes wrong. Ignore this for -* now until we solve this for real. -*/ -mutex_lock (&fb_helper->dev->struct_mutex); -intel_fb_obj_invalidate (ifbdev->fb->obj,ORIGIN_GTT ); -mutex_unlock (&fb_helper->dev->struct_mutex); - } - -return ret; -} - -static int intel_fbdev_pan_display (struct fb_var_screeninfo *var, -struct fb_info *info) -{ -struct drm_fb_helper *fb_helper = info->par; -struct intel_fbdev *ifbdev = - container_of(fb_helper, struct intel_fbdev, helper); - -int ret; - ret =drm_fb_helper_pan_display (var, info); - -if (ret ==0 ) { -/* -* FIXME: fbdev presumes that all callbacks also work from -* atomic contexts and relies on that for emergency oops -* printing. KMS totally doesn't do that and the locking here is -* by far not the only place this goes wrong. Ignore this for -* now until we solve this for real. -*/ -mutex_lock (&fb_helper->dev->struct_mutex); -intel_fb_obj_invalidate (ifbdev->fb->obj,ORIGIN_GTT ); -mutex_unlock (&fb_helper->dev->struct_mutex); - } +struct intel_framebuffer *intel_fb = ifbdev->fb; +struct drm_framebuffer *fb = &intel_fb->base; -return ret; +/* +* Our fb dirty callback is just used to invalidate frontbuffer +* entirely. So just fb reference is needed and rest is ignored. +*/ + fb->funcs->dirty (fb,NULL ,0 ,0 ,NULL ,1 ); }static struct fb_ops intelfb_ops = { .owner =THIS_MODULE , .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = intel_fbdev_set_par, + .fb_set_par = drm_fb_helper_set_par, .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_pan_display = intel_fbdev_pan_display, - .fb_blank = intel_fbdev_blank, + .fb_dirty = intel_fbdev_dirty, + .fb_pan_display = drm_fb_helper_pan_display, + .fb_blank = drm_fb_helper_blank, .fb_setcmap = drm_fb_helper_setcmap, .fb_debug_enter = drm_fb_helper_debug_enter, .fb_debug_leave = drm_fb_helper_debug_leave,
drivers/gpu/drm/i915/intel_frontbuffer.c +0 -1
@@ -100,7 +100,6 @@ void intel_fb_obj_invalidate(struct drm_i915_gem_object *obj,if (fb_dirty)return ; -DRM_ERROR ("PSR FBT invalidate dirty\n" ); }if (origin ==ORIGIN_CS ) {
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 16 lines · Rodrigo Vivi
This patch introduces a frontbuffer invalidation on dirty fb user callback.
It is mainly used for DIRTYFB drm ioctl, but can be extended for fbdev use on following patch.
This patch itself already solves the biggest PSR known issue, that is missed screen updates during boot, mainly when there is a splash screen involved like plymouth.
Plymoth will do a modeset over ioctl that flushes frontbuffer tracking and PSR gets back to work while it cannot track the screen updates and exit properly. However plymouth also uses a dirtyfb ioctl whenever updating the screen. So let's use it to invalidate PSR back again.
Quoted 8 lines
This patch also introduces the
ORIGIN_FB_DIRTYto frontbuffer tracking. The reason is that whenever using this invalidate path we don't need to keep continuously invalidating the frontbuffer for every call. One call between flips is enough to keep frontbuffer tracking invalidated and let all users aware. If a sync or async flip completed it means that we probably can flush everything and enable powersavings features back. If this isn't the case on the next dirty call we invalidate it again until next flip.
Sounds like we need yet another testcase in the frontbuffer tracking test from Paulo for this case, i.e.
- Allocate a dumb buffer.
- Mmap dumb buffer (both using the dumb bo ioctls, not the i915 ones).
- Do modeset using that buffer.
- Check that drawing using that mmap + dirtyfb works correctly.
Bunch more comments on the implementation below.
Quoted 70 lines
Signed-off-by Rodrigo Vivi <[email protected]>--- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/intel_display.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/intel_frontbuffer.c | 18 ++++++++++++++++++ 3 files changed, 38 insertions(+)drivers/gpu/drm/i915/i915_drv.h +2
-0@@ -889,6 +889,7 @@ enum fb_op_origin {ORIGIN_CPU ,ORIGIN_CS ,ORIGIN_FLIP , + ORIGIN_FB_DIRTY, }; struct i915_fbc {@@ -1628,6 +1629,7 @@ struct i915_frontbuffer_tracking {*/ unsigned busy_bits;unsigned flip_bits; +bool fb_dirty; };struct i915_wa_reg {drivers/gpu/drm/i915/intel_display.c +18
-0@@ -14330,9 +14330,27 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,return drm_gem_handle_create (file, &obj->base, handle); } +static int intel_user_framebuffer_dirty (struct drm_framebuffer *fb, +struct drm_file *file, +unsigned flags,unsigned color, +struct drm_clip_rect *clips, +unsigned num_clips) +{ +struct drm_device *dev = fb->dev; +struct intel_framebuffer *intel_fb =to_intel_framebuffer (fb); +struct drm_i915_gem_object *obj = intel_fb->obj; + +mutex_lock (&dev->struct_mutex); +intel_fb_obj_invalidate (obj,ORIGIN_FB_DIRTY ); +mutex_unlock (&dev->struct_mutex); + +return 0 ; +} +static const struct drm_framebuffer_funcs intel_fb_funcs = { .destroy = intel_user_framebuffer_destroy, .create_handle = intel_user_framebuffer_create_handle, + .dirty = intel_user_framebuffer_dirty, }; staticdrivers/gpu/drm/i915/intel_frontbuffer.c +1
-0@@ -81,12 +81,28 @@ void intel_fb_obj_invalidate(struct drm_i915_gem_object *obj, {struct drm_device *dev = obj->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev); +bool fb_dirty;
drivers/gpu/drm/i915/intel_frontbuffer.c void intel_fb_obj_invalidate(struct drm_i915_gem_object *obj, · line 95
Quoted 10 lines
drivers/gpu/drm/i915/intel_frontbuffer.c +5
-0WARN_ON (!mutex_is_locked (&dev->struct_mutex));if (!obj->frontbuffer_bits)return ; +/* +* We just invalidate the frontbuffer on the first dirty and keep +* it dirty and invalid until next flip. +*/ +if (origin ==ORIGIN_FB_DIRTY ) {
ORIGIN_FB_DIRTY == ORIGIN_GTT, at least on the hw side. Except that dirty_fb actually is a flush (it's supposed to be done _after_ some drawing has been done).
I don't think we need to add more tracking state for this, or at least I don't understand exactly why we need all those fb_dirty state.
Quoted 36 lines
drivers/gpu/drm/i915/intel_frontbuffer.c +12
-0+mutex_lock (&dev_priv->fb_tracking.lock); + fb_dirty = dev_priv->fb_tracking.fb_dirty; + dev_priv->fb_tracking.fb_dirty = true; +mutex_unlock (&dev_priv->fb_tracking.lock); + +if (fb_dirty) +return ; +DRM_ERROR ("PSR FBT invalidate dirty\n" ); + } +if (origin ==ORIGIN_CS ) {mutex_lock (&dev_priv->fb_tracking.lock); dev_priv->fb_tracking.busy_bits@@ -207,6 +223,7 @@ void intel_frontbuffer_flip_complete(struct drm_device *dev,struct drm_i915_private *dev_priv =to_i915 (dev);mutex_lock (&dev_priv->fb_tracking.lock); + dev_priv->fb_tracking.fb_dirty = false;/* Mask any cancelled flips. */ frontbuffer_bits &= dev_priv->fb_tracking.flip_bits; dev_priv->fb_tracking.flip_bits &= ~frontbuffer_bits;@@ -233,6 +250,7 @@ void intel_frontbuffer_flip(struct drm_device *dev,struct drm_i915_private *dev_priv =to_i915 (dev);mutex_lock (&dev_priv->fb_tracking.lock); + dev_priv->fb_tracking.fb_dirty = false;/* Remove stale busy bits due to the old buffer. */ dev_priv->fb_tracking.busy_bits &= ~frontbuffer_bits;mutex_unlock (&dev_priv->fb_tracking.lock);Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 123 lines · Daniel Vetter
Quoted 16 lines · Rodrigo Vivi
This patch introduces a frontbuffer invalidation on dirty fb user callback.
It is mainly used for DIRTYFB drm ioctl, but can be extended for fbdev use on following patch.
This patch itself already solves the biggest PSR known issue, that is missed screen updates during boot, mainly when there is a splash screen involved like plymouth.
Plymoth will do a modeset over ioctl that flushes frontbuffer tracking and PSR gets back to work while it cannot track the screen updates and exit properly. However plymouth also uses a dirtyfb ioctl whenever updating the screen. So let's use it to invalidate PSR back again.
Quoted 8 lines
This patch also introduces the
ORIGIN_FB_DIRTYto frontbuffer tracking. The reason is that whenever using this invalidate path we don't need to keep continuously invalidating the frontbuffer for every call. One call between flips is enough to keep frontbuffer tracking invalidated and let all users aware. If a sync or async flip completed it means that we probably can flush everything and enable powersavings features back. If this isn't the case on the next dirty call we invalidate it again until next flip.Sounds like we need yet another testcase in the frontbuffer tracking test from Paulo for this case, i.e.
- Allocate a dumb buffer.
- Mmap dumb buffer (both using the dumb bo ioctls, not the i915 ones).
- Do modeset using that buffer.
- Check that drawing using that mmap + dirtyfb works correctly.Bunch more comments on the implementation below.
Review
Quoted 9 lines
Signed-off-by Rodrigo Vivi <[email protected]>--- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/intel_display.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/intel_frontbuffer.c | 18 ++++++++++++++++++ 3 files changed, 38 insertions(+)(quoted diff) +0
-0
b/drivers/gpu/drm/i915/i915_drv.hReview
Quoted 20 lines
index ea9caf2..e0591d3 100644
drivers/gpu/drm/i915/i915_drv.h +2
-0@@ -889,6 +889,7 @@ enum fb_op_origin {ORIGIN_CPU ,ORIGIN_CS ,ORIGIN_FLIP , + ORIGIN_FB_DIRTY, }; struct i915_fbc {@@ -1628,6 +1629,7 @@ struct i915_frontbuffer_tracking {*/ unsigned busy_bits;unsigned flip_bits; +bool fb_dirty; };struct i915_wa_reg {(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_display.cdrivers/gpu/drm/i915/intel_display.c static int
Quoted 4 lines
index 01eaab8..19c2ab3 100644
drivers/gpu/drm/i915/intel_display.c +0
-0@@ -14330,9 +14330,27 @@ static intintel_user_framebuffer_create_handle(struct
drm_framebuffer*fb,drivers/gpu/drm/i915/intel_display.c static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,
Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +3
-0return drm_gem_handle_create (file, &obj->base, handle); } +static int intel_user_framebuffer_dirty (struct drm_framebuffer *fb, +struct drm_file *file, + unsigned flags, unsignedcolor,
Review
Quoted 22 lines
drivers/gpu/drm/i915/intel_display.c +15
-0+ struct drm_clip_rect *clips, + unsigned num_clips) +{ +struct drm_device *dev = fb->dev; +struct intel_framebuffer *intel_fb =to_intel_framebuffer (fb); +struct drm_i915_gem_object *obj = intel_fb->obj; + +mutex_lock (&dev->struct_mutex); +intel_fb_obj_invalidate (obj,ORIGIN_FB_DIRTY ); +mutex_unlock (&dev->struct_mutex); + +return 0 ; +} +static const struct drm_framebuffer_funcs intel_fb_funcs = { .destroy = intel_user_framebuffer_destroy, .create_handle = intel_user_framebuffer_create_handle, + .dirty = intel_user_framebuffer_dirty, }; static(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_frontbuffer.cdrivers/gpu/drm/i915/intel_frontbuffer.c void intel_fb_obj_invalidate(struct
Quoted 4 lines
index 6e90e2b..329b6fc 100644
drivers/gpu/drm/i915/intel_frontbuffer.c +0
-0@@ -81,12 +81,28 @@ void intel_fb_obj_invalidate(struct
drm_i915_gem_object*obj,Quoted 5 lines
drivers/gpu/drm/i915/intel_frontbuffer.c +1
-0{struct drm_device *dev = obj->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev); +bool fb_dirty;drivers/gpu/drm/i915/intel_frontbuffer.c void intel_fb_obj_invalidate(struct drm_i915_gem_object *obj, · line 95
Quoted 10 lines
drivers/gpu/drm/i915/intel_frontbuffer.c +5
-0WARN_ON (!mutex_is_locked (&dev->struct_mutex));if (!obj->frontbuffer_bits)return ; +/* +* We just invalidate the frontbuffer on the first dirty and keep +* it dirty and invalid until next flip. +*/ +if (origin ==ORIGIN_FB_DIRTY ) {
Quoted 7 lines
ORIGIN_FB_DIRTY==ORIGIN_GTT, at least on the hw side. Except thatdirty_fbactually is a flush (it's supposed to be done _after_ some drawing has been done).I don't think we need to add more tracking state for this, or at least I don't understand exactly why we need all those
fb_dirtystate.
I agree.. Just created this to be more generic and use for fbdev that could call for every single screen update. So in this case we would want to minimize the amount of invalidation... but forget about it....
Quoted 34 lines
drivers/gpu/drm/i915/intel_frontbuffer.c void intel_frontbuffer_flip_complete(struct
Quoted 15 lines
drivers/gpu/drm/i915/intel_frontbuffer.c +10
-0+mutex_lock (&dev_priv->fb_tracking.lock); + fb_dirty = dev_priv->fb_tracking.fb_dirty; + dev_priv->fb_tracking.fb_dirty = true; +mutex_unlock (&dev_priv->fb_tracking.lock); + +if (fb_dirty) +return ; +DRM_ERROR ("PSR FBT invalidate dirty\n" ); + } +if (origin ==ORIGIN_CS ) {mutex_lock (&dev_priv->fb_tracking.lock); dev_priv->fb_tracking.busy_bits@@ -207,6 +223,7 @@ void intel_frontbuffer_flip_complete(struct
drm_device*dev,Quoted 18 lines
drivers/gpu/drm/i915/intel_frontbuffer.c +2
-1struct drm_i915_private *dev_priv =to_i915 (dev);mutex_lock (&dev_priv->fb_tracking.lock); + dev_priv->fb_tracking.fb_dirty = false;/* Mask any cancelled flips. */ frontbuffer_bits &= dev_priv->fb_tracking.flip_bits; dev_priv->fb_tracking.flip_bits &= ~frontbuffer_bits;@@ -233,6 +250,7 @@ void intel_frontbuffer_flip(struct drm_device *dev,struct drm_i915_private *dev_priv =to_i915 (dev);mutex_lock (&dev_priv->fb_tracking.lock); + dev_priv->fb_tracking.fb_dirty = false;/* Remove stale busy bits due to the old buffer. */ dev_priv->fb_tracking.busy_bits &= ~frontbuffer_bits;mutex_unlock (&dev_priv->fb_tracking.lock); --2.1.0
Quoted 14 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel