<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 30, 2015 at 12:08 AM Daniel Vetter <<a href="mailto:daniel@ffwll.ch">daniel@ffwll.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Jun 29, 2015 at 01:44:46PM -0700, Rodrigo Vivi wrote:<br>
> Now that we have fb user dirty invalidating frontbuffer and we have<br>
> the new fbdev dirty callback let's merge them.<br>
><br>
> So it doesn't matter if fbcon throught fbdev or splash screen throught<br>
> drm_ioctl_dirtyfb, in any case we will have frontbuffer properly<br>
> invalidated and power savings features that rely on frontbuffer tracking<br>
> will be able to work as expected.<br>
><br>
> Signed-off-by: Rodrigo Vivi <<a href="mailto:rodrigo.vivi@intel.com" target="_blank">rodrigo.vivi@intel.com</a>><br>
<br>
Hm, I think we still need these but not sure. There's also fbdev client<br>
from userspace which directly draw into the mmap area. But tbh no idea how<br>
those are supposed to work with manually updating screens (like i915 psr,<br>
udl or qxl).<br></blockquote><div><br></div><div>Oh! Agree... I got the issue after blank so we still need those... </div><div><br></div><div>Let's forget about these fbdev changes and focus on a simple fb user dirty ops that fix the current real remaining issue...</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Daniel<br>
<br>
> ---<br>
> drivers/gpu/drm/i915/intel_fbdev.c | 86 ++++++--------------------------------<br>
> 1 file changed, 13 insertions(+), 73 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c<br>
> index 2a1724e..f1592c7 100644<br>
> --- a/drivers/gpu/drm/i915/intel_fbdev.c<br>
> +++ b/drivers/gpu/drm/i915/intel_fbdev.c<br>
> @@ -45,92 +45,32 @@<br>
> #include <drm/i915_drm.h><br>
> #include "i915_drv.h"<br>
><br>
> -static int intel_fbdev_set_par(struct fb_info *info)<br>
> +static void intel_fbdev_dirty(struct fb_info *info, u32 x1, u32 y1,<br>
> + u32 x2, u32 y2)<br>
> {<br>
> struct drm_fb_helper *fb_helper = info->par;<br>
> struct intel_fbdev *ifbdev =<br>
> container_of(fb_helper, struct intel_fbdev, helper);<br>
> - int ret;<br>
> -<br>
> - ret = drm_fb_helper_set_par(info);<br>
> -<br>
> - if (ret == 0) {<br>
> - /*<br>
> - * FIXME: fbdev presumes that all callbacks also work from<br>
> - * atomic contexts and relies on that for emergency oops<br>
> - * printing. KMS totally doesn't do that and the locking here is<br>
> - * by far not the only place this goes wrong. Ignore this for<br>
> - * now until we solve this for real.<br>
> - */<br>
> - mutex_lock(&fb_helper->dev->struct_mutex);<br>
> - ret = i915_gem_object_set_to_gtt_domain(ifbdev->fb->obj,<br>
> - true);<br>
> - mutex_unlock(&fb_helper->dev->struct_mutex);<br>
> - }<br>
> -<br>
> - return ret;<br>
> -}<br>
> -<br>
> -static int intel_fbdev_blank(int blank, struct fb_info *info)<br>
> -{<br>
> - struct drm_fb_helper *fb_helper = info->par;<br>
> - struct intel_fbdev *ifbdev =<br>
> - container_of(fb_helper, struct intel_fbdev, helper);<br>
> - int ret;<br>
> -<br>
> - ret = drm_fb_helper_blank(blank, info);<br>
> -<br>
> - if (ret == 0) {<br>
> - /*<br>
> - * FIXME: fbdev presumes that all callbacks also work from<br>
> - * atomic contexts and relies on that for emergency oops<br>
> - * printing. KMS totally doesn't do that and the locking here is<br>
> - * by far not the only place this goes wrong. Ignore this for<br>
> - * now until we solve this for real.<br>
> - */<br>
> - mutex_lock(&fb_helper->dev->struct_mutex);<br>
> - intel_fb_obj_invalidate(ifbdev->fb->obj, ORIGIN_GTT);<br>
> - mutex_unlock(&fb_helper->dev->struct_mutex);<br>
> - }<br>
> -<br>
> - return ret;<br>
> -}<br>
> -<br>
> -static int intel_fbdev_pan_display(struct fb_var_screeninfo *var,<br>
> - struct fb_info *info)<br>
> -{<br>
> - struct drm_fb_helper *fb_helper = info->par;<br>
> - struct intel_fbdev *ifbdev =<br>
> - container_of(fb_helper, struct intel_fbdev, helper);<br>
> -<br>
> - int ret;<br>
> - ret = drm_fb_helper_pan_display(var, info);<br>
> -<br>
> - if (ret == 0) {<br>
> - /*<br>
> - * FIXME: fbdev presumes that all callbacks also work from<br>
> - * atomic contexts and relies on that for emergency oops<br>
> - * printing. KMS totally doesn't do that and the locking here is<br>
> - * by far not the only place this goes wrong. Ignore this for<br>
> - * now until we solve this for real.<br>
> - */<br>
> - mutex_lock(&fb_helper->dev->struct_mutex);<br>
> - intel_fb_obj_invalidate(ifbdev->fb->obj, ORIGIN_GTT);<br>
> - mutex_unlock(&fb_helper->dev->struct_mutex);<br>
> - }<br>
> + struct intel_framebuffer *intel_fb = ifbdev->fb;<br>
> + struct drm_framebuffer *fb = &intel_fb->base;<br>
><br>
> - return ret;<br>
> + /*<br>
> + * Our fb dirty callback is just used to invalidate frontbuffer<br>
> + * entirely. So just fb reference is needed and rest is ignored.<br>
> + */<br>
> + fb->funcs->dirty(fb, NULL, 0, 0, NULL, 1);<br>
> }<br>
><br>
> static struct fb_ops intelfb_ops = {<br>
> .owner = THIS_MODULE,<br>
> .fb_check_var = drm_fb_helper_check_var,<br>
> - .fb_set_par = intel_fbdev_set_par,<br>
> + .fb_set_par = drm_fb_helper_set_par,<br>
> .fb_fillrect = cfb_fillrect,<br>
> .fb_copyarea = cfb_copyarea,<br>
> .fb_imageblit = cfb_imageblit,<br>
> - .fb_pan_display = intel_fbdev_pan_display,<br>
> - .fb_blank = intel_fbdev_blank,<br>
> + .fb_dirty = intel_fbdev_dirty,<br>
> + .fb_pan_display = drm_fb_helper_pan_display,<br>
> + .fb_blank = drm_fb_helper_blank,<br>
> .fb_setcmap = drm_fb_helper_setcmap,<br>
> .fb_debug_enter = drm_fb_helper_debug_enter,<br>
> .fb_debug_leave = drm_fb_helper_debug_leave,<br>
> --<br>
> 2.1.0<br>
><br>
> _______________________________________________<br>
> Intel-gfx mailing list<br>
> <a href="mailto:Intel-gfx@lists.freedesktop.org" target="_blank">Intel-gfx@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/intel-gfx" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/intel-gfx</a><br>
<br>
--<br>
Daniel Vetter<br>
Software Engineer, Intel Corporation<br>
<a href="http://blog.ffwll.ch" rel="noreferrer" target="_blank">http://blog.ffwll.ch</a><br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</blockquote></div></div>