Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 366580 Details for
Bug 496516
enable double-buffering in the vmware fbdev driver
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
linux-3.10.7-gentoo-enable-vmwgfx-double-buffering.patch
linux-3.10.7-gentoo-enable-vmwgfx-double-buffering.patch (text/plain), 5.13 KB, created by
Christopher Friedt
on 2013-12-30 17:21:14 UTC
(
hide
)
Description:
linux-3.10.7-gentoo-enable-vmwgfx-double-buffering.patch
Filename:
MIME Type:
Creator:
Christopher Friedt
Created:
2013-12-30 17:21:14 UTC
Size:
5.13 KB
patch
obsolete
>diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig >index b71bcd0..1d5da0a 100644 >--- a/drivers/gpu/drm/vmwgfx/Kconfig >+++ b/drivers/gpu/drm/vmwgfx/Kconfig >@@ -20,3 +20,14 @@ config DRM_VMWGFX_FBCON > Choose this option if you are shipping a new vmwgfx > userspace driver that supports using the kernel driver. > >+config DRM_VMWGFX_FB_PAN >+ depends on DRM_VMWGFX >+ bool "Support non-kms page-flipping" >+ help >+ Choose this option if you are using the old-style fbdev >+ interface and would like to use the FBIOPAN_DISPLAY ioctl for >+ multi-buffering. Enable the feature by setting yres_virtual >+ to an integral multiple greater than yres. Disable the feature >+ by setting yres_virtual to something else. >+ Warning: while page-flipping is enabled, painting to the >+ front-buffer is not currently possible. >diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c >index 021b522..bafe105 100644 >--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c >+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c >@@ -55,6 +55,7 @@ struct vmw_fb_par { > unsigned bo_size; > bool bo_iowrite; > >+ /* for page-fault screen updates (single-buffered) */ > struct { > spinlock_t lock; > bool active; >@@ -63,8 +64,17 @@ struct vmw_fb_par { > unsigned x2; > unsigned y2; > } dirty; >+ >+ /* for pan-based screen updates (multi-buffered) */ >+ struct delayed_work pan_delayed_work; > }; > >+struct fb_deferred_io vmw_defio; >+static void vmw_deferred_io(struct fb_info *info, >+ struct list_head *pagelist); >+static void vmw_deferred_io_noop(struct fb_info *info, >+ struct list_head *pagelist); >+ > static int vmw_fb_setcolreg(unsigned regno, unsigned red, unsigned green, > unsigned blue, unsigned transp, > struct fb_info *info) >@@ -188,13 +198,46 @@ static int vmw_fb_set_par(struct fb_info *info) > */ > WARN_ON(vmw_read(vmw_priv, SVGA_REG_FB_OFFSET) != 0); > >+#ifdef CONFIG_DRM_VMWGFX_FB_PAN >+ if ( >+ info->var.yres_virtual > info->var.yres && >+ !(info->var.yres_virtual % info->var.yres) >+ ) { >+ /* the fb_deferred_io work that happens as a result of page faults >+ * is disabled, user _must_ manually pan display >+ */ >+ cancel_delayed_work_sync(&info->deferred_work); >+ vmw_defio.deferred_io = vmw_deferred_io_noop; >+ } else { >+ /* the fb_deferred_io work that happens as a result of page faults >+ * is enabled >+ */ >+ cancel_delayed_work_sync(&par->pan_delayed_work); >+ vmw_defio.deferred_io = vmw_deferred_io; >+ } >+#endif >+ > return 0; > } > > static int vmw_fb_pan_display(struct fb_var_screeninfo *var, > struct fb_info *info) > { >- return 0; >+ int ret = 0; >+#ifdef CONFIG_DRM_VMWGFX_FB_PAN >+ struct vmw_fb_par *par = info->par; >+ >+ ret = >+ var->yoffset >= info->var.yres_virtual || >+ var->yoffset % info->var.yres >+ ? -EINVAL >+ : 0; >+ if ( !ret ) { >+ info->var.yoffset = var->yoffset; >+ schedule_delayed_work(&par->pan_delayed_work, VMW_DIRTY_DELAY); >+ } >+#endif >+ return ret; > } > > static int vmw_fb_blank(int blank, struct fb_info *info) >@@ -325,11 +368,55 @@ static void vmw_deferred_io(struct fb_info *info, > vmw_fb_dirty_flush(par); > }; > >+static void vmw_deferred_io_noop(struct fb_info *info, >+ struct list_head *pagelist) >+{ >+} >+ > struct fb_deferred_io vmw_defio = { > .delay = VMW_DIRTY_DELAY, > .deferred_io = vmw_deferred_io, > }; > >+static void vmw_delayed_work_pan(struct work_struct *work) >+{ >+ int i, k; >+ >+ struct vmw_fb_par *par = container_of(work, struct vmw_fb_par, >+ pan_delayed_work.work); >+ struct vmw_private *vmw_priv = par->vmw_priv; >+ struct fb_info *info = vmw_priv->fb_info; >+ >+ int *src = (int *)info->screen_base; >+ __le32 __iomem *vram_mem = par->bo_ptr; >+ >+ struct { >+ uint32_t header; >+ SVGAFifoCmdUpdate body; >+ } *cmd; >+ >+ for( >+ i=0, k=info->var.yoffset*info->var.xres; >+ i<info->var.yres*info->var.xres; >+ k++, i++ >+ ) { >+ iowrite32(src[k], vram_mem + i); >+ } >+ >+ cmd = vmw_fifo_reserve(vmw_priv, sizeof(*cmd)); >+ if (unlikely(cmd == NULL)) { >+ DRM_ERROR("Fifo reserve failed.\n"); >+ return; >+ } >+ >+ cmd->header = cpu_to_le32(SVGA_CMD_UPDATE); >+ cmd->body.x = cpu_to_le32(0); >+ cmd->body.y = cpu_to_le32(0); >+ cmd->body.width = cpu_to_le32(info->var.xres); >+ cmd->body.height = cpu_to_le32(info->var.yres); >+ vmw_fifo_commit(vmw_priv, sizeof(*cmd)); >+} >+ > /* > * Draw code > */ >@@ -533,6 +620,9 @@ int vmw_fb_init(struct vmw_private *vmw_priv) > spin_lock_init(&par->dirty.lock); > info->fbdefio = &vmw_defio; > fb_deferred_io_init(info); >+ if ( CONFIG_DRM_VMWGFX_FB_PAN ) { >+ INIT_DELAYED_WORK(&par->pan_delayed_work, vmw_delayed_work_pan); >+ } > > ret = register_framebuffer(info); > if (unlikely(ret != 0)) >@@ -569,6 +659,9 @@ int vmw_fb_close(struct vmw_private *vmw_priv) > par->vmw_bo = NULL; > > /* ??? order */ >+ if ( CONFIG_DRM_VMWGFX_FB_PAN ) { >+ cancel_delayed_work_sync(&par->pan_delayed_work); >+ } > fb_deferred_io_cleanup(info); > unregister_framebuffer(info); > >@@ -598,6 +691,9 @@ int vmw_fb_off(struct vmw_private *vmw_priv) > spin_unlock_irqrestore(&par->dirty.lock, flags); > > flush_delayed_work(&info->deferred_work); >+ if ( CONFIG_DRM_VMWGFX_FB_PAN ) { >+ flush_delayed_work(&par->pan_delayed_work); >+ } > > par->bo_ptr = NULL; > ttm_bo_kunmap(&par->map);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 496516
: 366580