vmwgfx update
Subsystems (3)
cover vmwgfx update
This patch series basically brings vmwgfx up to date with the standalone repo. Mostly bug-fixes but some new features as well. Most notably the in-kernel time-based throttling support which is advertized by a minor version bump.
PATCH 1/13 drm/vmwgfx: Assume larger framebuffer max size.
From: Jakob Bornecrantz <[email protected]>
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +3 -2
@@ -771,8 +771,9 @@ int vmw_kms_init(struct vmw_private *dev_priv) dev->mode_config.funcs = &vmw_kms_funcs; dev->mode_config.min_width =1 ; dev->mode_config.min_height =1 ; - dev->mode_config.max_width = dev_priv->fb_max_width; - dev->mode_config.max_height = dev_priv->fb_max_height; +/* assumed largest fb size */ + dev->mode_config.max_width =8192 ; + dev->mode_config.max_height =8192 ; ret =vmw_kms_init_legacy_display_system (dev_priv);
Signature · 1 line
1.6.2.5
PATCH 2/13 drm/vmwgfx: Fix single framebuffer detection.
From: Jakob Bornecrantz <[email protected]>
--- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +3 -0
@@ -130,6 +130,7 @@ static int vmw_ldu_del_active(struct vmw_private *vmw_priv,if (list_empty (&ldu->active))return 0 ; +/* must init otherwise list_empty(&ldu->active) well not work */ list_del_init (&ldu->active);if (--(ld->num_active) ==0 ) {BUG_ON (!ld->fb);
@@ -208,6 +209,8 @@ static int vmw_ldu_crtc_set_config(struct drm_mode_set *set)/* ldu only supports one fb active at the time */ if (dev_priv->ldu_priv->fb && vfb && + !(dev_priv->ldu_priv->num_active ==1 && + !list_empty (&ldu->active)) && dev_priv->ldu_priv->fb != vfb) {DRM_ERROR ("Multiple framebuffers not supported\n" );return -EINVAL ;
Signature · 1 line
1.6.2.5
PATCH 3/13 drm/vmwgfx: Make sure to unpin old and pin new framebuffer.
From: Jakob Bornecrantz <[email protected]>
--- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +11 -6
@@ -150,6 +150,15 @@ static int vmw_ldu_add_active(struct vmw_private *vmw_priv,struct vmw_legacy_display_unit *entry;struct list_head *at; +BUG_ON (!ld->num_active && ld->fb); +if (vfb != ld->fb) { +if (ld->fb && ld->fb->unpin) + ld->fb->unpin (ld->fb); +if (vfb->pin) + vfb->pin (vfb); + ld->fb = vfb; + } +if (!list_empty (&ldu->active))return 0 ;
@@ -162,12 +171,8 @@ static int vmw_ldu_add_active(struct vmw_private *vmw_priv, }list_add (&ldu->active, at); -if (ld->num_active++ ==0 ) { -BUG_ON (ld->fb); -if (vfb->pin) - vfb->pin (vfb); - ld->fb = vfb; - } + + ld->num_active++;return 0 ; }
Signature · 1 line
1.6.2.5
PATCH 4/13 drm/vmwgfx: Add kernel throttling support. Bump minor.
The throttle_us member in the execbuf argument is now honored. If the member is 0, no waiting for lag will occur, which guarantees backwards compatibility with well-behaved clients.
--- drivers/gpu/drm/vmwgfx/Makefile | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 27 +++++- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 9 ++ drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 173 +++++++++++++++++++++++++++++++ drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 5 +- drivers/gpu/drm/vmwgfx/vmwgfx_irq.c | 17 +++- 6 files changed, 227 insertions(+), 6 deletions(-) create mode 100644 drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
drivers/gpu/drm/vmwgfx/Makefile +1 -1
@@ -4,6 +4,6 @@ ccflags-y := -Iinclude/drm vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \ vmwgfx_fb.o vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_buffer.o \ vmwgfx_fifo.o vmwgfx_irq.o vmwgfx_ldu.o vmwgfx_ttm_glue.o \ - vmwgfx_overlay.o + vmwgfx_overlay.o vmwgfx_fence.o obj-$(CONFIG_DRM_VMWGFX) := vmwgfx.o
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +26 -1
@@ -41,7 +41,7 @@#define VMWGFX_DRIVER_DATE "20100209"#define VMWGFX_DRIVER_MAJOR 1 -#define VMWGFX_DRIVER_MINOR 0 +#define VMWGFX_DRIVER_MINOR 1#define VMWGFX_DRIVER_PATCHLEVEL 0#define VMWGFX_FILE_PAGE_OFFSET 0x00100000#define VMWGFX_FIFO_STATIC_SIZE (1024*1024)
@@ -102,6 +102,13 @@ struct vmw_surface {struct vmw_cursor_snooper snooper; }; +struct vmw_fence_queue { +struct list_head head; +struct timespec lag; +struct timespec lag_time; +spinlock_t lock; +}; +struct vmw_fifo_state {unsigned long reserved_size;__le32 *dynamic_buffer;
@@ -115,6 +122,7 @@ struct vmw_fifo_state {uint32_t capabilities;struct mutex fifo_mutex;struct rw_semaphore rwsem; +struct vmw_fence_queue fence_queue; };struct vmw_relocation {
@@ -441,6 +449,23 @@ extern int vmw_fallback_wait(struct vmw_private *dev_priv,uint32_t sequence, bool interruptible, unsigned long timeout); +extern void vmw_update_sequence (struct vmw_private *dev_priv, +struct vmw_fifo_state *fifo_state); + + +/** +* Rudimentary fence objects currently used only for throttling - +* vmwgfx_fence.c +*/ + +extern void vmw_fence_queue_init (struct vmw_fence_queue *queue); +extern void vmw_fence_queue_takedown (struct vmw_fence_queue *queue); +extern int vmw_fence_push (struct vmw_fence_queue *queue, +uint32_t sequence); +extern int vmw_fence_pull (struct vmw_fence_queue *queue, +uint32_t signaled_sequence); +extern int vmw_wait_lag (struct vmw_private *dev_priv, +struct vmw_fence_queue *queue,uint32_t us);/** * Kernel framebuffer - vmwgfx_fb.c
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +9 -0
@@ -669,6 +669,15 @@ int vmw_execbuf_ioctl(struct drm_device *dev, void *data, goto out_err;vmw_apply_relocations (sw_context); + +if (arg->throttle_us) { + ret =vmw_wait_lag (dev_priv, &dev_priv->fifo.fence_queue, + arg->throttle_us); + +if (unlikely (ret !=0 )) + goto out_err; + } +vmw_fifo_commit (dev_priv, arg->command_size); ret =vmw_fifo_send_fence (dev_priv, &sequence);
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c new file +173 -0
173 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +4 -1
@@ -120,7 +120,7 @@ int vmw_fifo_init(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo)atomic_set (&dev_priv->fence_seq, dev_priv->last_read_sequence);iowrite32 (dev_priv->last_read_sequence, fifo_mem +SVGA_FIFO_FENCE ); - +vmw_fence_queue_init (&fifo->fence_queue);return vmw_fifo_send_fence (dev_priv, &dummy); out_err:vfree (fifo->static_buffer);
@@ -159,6 +159,7 @@ void vmw_fifo_release(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo) dev_priv->enable_state);mutex_unlock (&dev_priv->hw_mutex); +vmw_fence_queue_takedown (&fifo->fence_queue);if (likely (fifo->last_buffer !=NULL )) {vfree (fifo->last_buffer);
@@ -484,6 +485,8 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *sequence) fifo_state->last_buffer_add = true;vmw_fifo_commit (dev_priv, bytes); fifo_state->last_buffer_add = false; + (void )vmw_fence_push (&fifo_state->fence_queue, *sequence); +vmw_update_sequence (dev_priv, fifo_state); out_err:return ret;
drivers/gpu/drm/vmwgfx/vmwgfx_irq.c +14 -3
@@ -64,22 +64,33 @@ static bool vmw_fifo_idle(struct vmw_private *dev_priv, uint32_t sequence)return (busy ==0 ); } +void vmw_update_sequence (struct vmw_private *dev_priv, +struct vmw_fifo_state *fifo_state) +{ +__le32 __iomem *fifo_mem = dev_priv->mmio_virt; + +uint32_t sequence =ioread32 (fifo_mem +SVGA_FIFO_FENCE ); + +if (dev_priv->last_read_sequence != sequence) { + dev_priv->last_read_sequence = sequence; +vmw_fence_pull (&fifo_state->fence_queue, sequence); + } +}bool vmw_fence_signaled (struct vmw_private *dev_priv,uint32_t sequence) { -__le32 __iomem *fifo_mem = dev_priv->mmio_virt;struct vmw_fifo_state *fifo_state;bool ret;if (likely (dev_priv->last_read_sequence - sequence <VMW_FENCE_WRAP ))return true; - dev_priv->last_read_sequence =ioread32 (fifo_mem +SVGA_FIFO_FENCE ); + fifo_state = &dev_priv->fifo; +vmw_update_sequence (dev_priv, fifo_state);if (likely (dev_priv->last_read_sequence - sequence <VMW_FENCE_WRAP ))return true; - fifo_state = &dev_priv->fifo;if (!(fifo_state->capabilities &SVGA_FIFO_CAP_FENCE ) &&vmw_fifo_idle (dev_priv, sequence))return true;
Signature · 1 line
1.6.2.5
PATCH 5/13 drm/vmwgfx: Get connector status from detection function.
From: Jakob Bornecrantz <[email protected]>
Also make sure the ldu::active member is properly initialized. Part of fix by Michel Daenzer <[email protected]>.
--- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +3 -7
@@ -456,13 +456,11 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit) encoder = &ldu->base.encoder; connector = &ldu->base.connector; +INIT_LIST_HEAD (&ldu->active); +drm_connector_init (dev, connector, &vmw_legacy_connector_funcs,DRM_MODE_CONNECTOR_LVDS ); -/* Initial status */ -if (unit ==0 ) - connector->status = connector_status_connected; -else - connector->status = connector_status_disconnected; + connector->status =vmw_ldu_connector_detect (connector);drm_encoder_init (dev, encoder, &vmw_legacy_encoder_funcs,DRM_MODE_ENCODER_LVDS );
@@ -470,8 +468,6 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit) encoder->possible_crtcs = (1 << unit); encoder->possible_clones =0 ; -INIT_LIST_HEAD (&ldu->active); -drm_crtc_init (dev, crtc, &vmw_legacy_crtc_funcs); drm_connector_attach_property(connector,
Signature · 1 line
1.6.2.5
PATCH 6/13 drm/vmwgfx: Support older hardware.
From: Jakob Bornecrantz <[email protected]>
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 9 ++++ drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 5 ++ drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 81 ++++++++++++---------------------- drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 18 ++++++++ drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 72 +++++++++++++----------------- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 70 ++++++++++++++++++++++++----- 6 files changed, 148 insertions(+), 107 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +9 -0
@@ -318,6 +318,15 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) goto out_err3; } +/* need mmio memory to check for fifo pitchlock cap */ +if (!(dev_priv->capabilities &SVGA_CAP_DISPLAY_TOPOLOGY ) && + !(dev_priv->capabilities &SVGA_CAP_PITCHLOCK ) && + !vmw_fifo_have_pitchlock (dev_priv)) { + ret = -ENOSYS ; +DRM_ERROR ("Hardware has no pitchlock\n" ); + goto out_err4; + } + dev_priv->tdev =ttm_object_device_init (dev_priv->mem_global_ref.object,12 );
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +5 -0
@@ -187,6 +187,7 @@ struct vmw_private {uint32_t vga_red_mask;uint32_t vga_blue_mask;uint32_t vga_green_mask; +uint32_t vga_pitchlock;/* * Framebuffer info.
@@ -401,6 +402,7 @@ extern int vmw_fifo_send_fence(struct vmw_private *dev_priv,extern void vmw_fifo_ping_host (struct vmw_private *dev_priv,uint32_t reason);extern int vmw_fifo_mmap (struct file *filp,struct vm_area_struct *vma);extern bool vmw_fifo_have_3d (struct vmw_private *dev_priv); +extern bool vmw_fifo_have_pitchlock (struct vmw_private *dev_priv);/** * TTM glue - vmwgfx_ttm_glue.c
@@ -491,6 +493,9 @@ void vmw_kms_cursor_snoop(struct vmw_surface *srf,struct ttm_object_file *tfile, struct ttm_buffer_object *bo, SVGA3dCmdHeader *header); +void vmw_kms_write_svga (struct vmw_private *vmw_priv, +unsigned width,unsigned height,unsigned pitch, +unsigned bbp,unsigned depth);/** * Overlay control - vmwgfx_overlay.c
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +28 -53
131 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +18 -0
@@ -34,6 +34,9 @@ bool vmw_fifo_have_3d(struct vmw_private *dev_priv)__le32 __iomem *fifo_mem = dev_priv->mmio_virt;uint32_t fifo_min, hwversion; +if (!(dev_priv->capabilities &SVGA_CAP_EXTENDED_FIFO )) +return false; + fifo_min =ioread32 (fifo_mem +SVGA_FIFO_MIN );if (fifo_min <=SVGA_FIFO_3D_HWVERSION *sizeof (unsigned int ))return false;
@@ -48,6 +51,21 @@ bool vmw_fifo_have_3d(struct vmw_private *dev_priv)return true; } +bool vmw_fifo_have_pitchlock (struct vmw_private *dev_priv) +{ +__le32 __iomem *fifo_mem = dev_priv->mmio_virt; +uint32_t caps; + +if (!(dev_priv->capabilities &SVGA_CAP_EXTENDED_FIFO )) +return false; + + caps =ioread32 (fifo_mem +SVGA_FIFO_CAPABILITIES ); +if (caps &SVGA_FIFO_CAP_PITCHLOCK ) +return true; + +return false; +} +int vmw_fifo_init (struct vmw_private *dev_priv,struct vmw_fifo_state *fifo) {__le32 __iomem *fifo_mem = dev_priv->mmio_virt;
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +31 -41
108 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +57 -13
107 lines not on this page · raw message
Signature · 1 line
1.6.2.5
PATCH 7/13 drm/vmwgfx: Reserve first part of VRAM for framebuffer.
The host may be touching this part of VRAM at modesetting, even if we never use it ourselves, since we blit screen updates from 3D surfaces. Make sure no DMA buffers are placed in this part of VRAM.
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 39 +++++++++++++++++++++++++++++++++- 1 files changed, 37 insertions(+), 2 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +37 -2
@@ -30,6 +30,8 @@/* Might need a hrtimer here? */ #define VMWGFX_PRESENT_RATE ((HZ / 60 > 0) ? HZ / 60 : 1) +static int vmw_surface_dmabuf_pin (struct vmw_framebuffer *vfb); +static int vmw_surface_dmabuf_unpin (struct vmw_framebuffer *vfb);void vmw_display_unit_cleanup (struct vmw_display_unit *du) {
@@ -326,6 +328,7 @@ int vmw_framebuffer_create_handle(struct drm_framebuffer *fb,struct vmw_framebuffer_surface {struct vmw_framebuffer base;struct vmw_surface *surface; +struct vmw_dma_buffer *buffer;struct delayed_work d_work;struct mutex work_lock;bool present_fs;
@@ -500,8 +503,8 @@ int vmw_kms_new_framebuffer_surface(struct vmw_private *dev_priv, vfbs->base.base.depth =24 ; vfbs->base.base.width = width; vfbs->base.base.height = height; - vfbs->base.pin =NULL ; - vfbs->base.unpin =NULL ; + vfbs->base.pin = &vmw_surface_dmabuf_pin; + vfbs->base.unpin = &vmw_surface_dmabuf_unpin; vfbs->surface = surface;mutex_init (&vfbs->work_lock);INIT_DELAYED_WORK (&vfbs->d_work, &vmw_framebuffer_present_fs_callback);
@@ -589,6 +592,38 @@ static struct drm_framebuffer_funcs vmw_framebuffer_dmabuf_funcs = { .create_handle = vmw_framebuffer_create_handle, }; +static int vmw_surface_dmabuf_pin (struct vmw_framebuffer *vfb) +{ +struct vmw_private *dev_priv =vmw_priv (vfb->base.dev); +struct vmw_framebuffer_surface *vfbs = +vmw_framebuffer_to_vfbs (&vfb->base); +unsigned long size = vfbs->base.base.pitch * vfbs->base.base.height; +int ret; + + vfbs->buffer =kzalloc (sizeof (*vfbs->buffer),GFP_KERNEL ); + +vmw_overlay_pause_all (dev_priv); + ret =vmw_dmabuf_init (dev_priv, vfbs->buffer, size, + &vmw_vram_ne_placement, + false, &vmw_dmabuf_bo_free); +vmw_overlay_resume_all (dev_priv); + +return ret; +} + +static int vmw_surface_dmabuf_unpin (struct vmw_framebuffer *vfb) +{ +struct ttm_buffer_object *bo; +struct vmw_framebuffer_surface *vfbs = +vmw_framebuffer_to_vfbs (&vfb->base); + + bo = &vfbs->buffer->base; +ttm_bo_unref (&bo); + vfbs->buffer =NULL ; + +return 0 ; +} +static int vmw_framebuffer_dmabuf_pin (struct vmw_framebuffer *vfb) {struct vmw_private *dev_priv =vmw_priv (vfb->base.dev);
Signature · 1 line
1.6.2.5
PATCH 8/13 drm/vmwgfx: Remove duplicate member from struct vmw_legacy_display_unit.
From: Jakob Bornecrantz <[email protected]>
--- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +2 -4
@@ -50,8 +50,6 @@ struct vmw_legacy_display_unit {struct vmw_display_unit base;struct list_head active; - -unsigned unit; };static void vmw_ldu_destroy (struct vmw_legacy_display_unit *ldu)
@@ -204,7 +202,7 @@ static int vmw_ldu_add_active(struct vmw_private *vmw_priv, at = &ld->active;list_for_each_entry (entry, &ld->active, active) { -if (entry->unit > ldu->unit) +if (entry->base.unit > ldu->base.unit)break ; at = &entry->active;
@@ -491,7 +489,7 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)if (!ldu)return -ENOMEM ; - ldu->unit = unit; + ldu->base.unit = unit; crtc = &ldu->base.crtc; encoder = &ldu->base.encoder; connector = &ldu->base.connector;
Signature · 1 line
1.6.2.5
PATCH 9/13 drm/vmwgfx: Don't use SVGA_REG_ENABLE in modesetting code.
From: Jakob Bornecrantz <[email protected]>
We should not use SVGA_REG_ENABLE anywhere but in the fifo setup code, since it controls whether the device is active.
--- drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 4 ---- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 5 ----- 2 files changed, 0 insertions(+), 9 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +0 -4
@@ -153,7 +153,6 @@ static int vmw_fb_set_par(struct fb_info *info)struct vmw_private *vmw_priv = par->vmw_priv;if (vmw_priv->capabilities &SVGA_CAP_DISPLAY_TOPOLOGY ) { -vmw_write (vmw_priv,SVGA_REG_ENABLE ,0 );vmw_write (vmw_priv,SVGA_REG_DISPLAY_ID ,0 );vmw_write (vmw_priv,SVGA_REG_DISPLAY_IS_PRIMARY , true);vmw_write (vmw_priv,SVGA_REG_DISPLAY_POSITION_X ,0 );
@@ -175,13 +174,10 @@ static int vmw_fb_set_par(struct fb_info *info)vmw_write (vmw_priv,SVGA_REG_DISPLAY_HEIGHT , info->var.yres);vmw_write (vmw_priv,SVGA_REG_DISPLAY_ID ,SVGA_ID_INVALID );vmw_write (vmw_priv,SVGA_REG_NUM_GUEST_DISPLAYS ,1 ); -vmw_write (vmw_priv,SVGA_REG_ENABLE ,1 ); }else { -vmw_write (vmw_priv,SVGA_REG_ENABLE ,0 );vmw_kms_write_svga (vmw_priv, info->var.xres, info->var.yres, info->fix.line_length, par->bpp, par->depth); -vmw_write (vmw_priv,SVGA_REG_ENABLE ,1 ); }
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +0 -5
@@ -107,16 +107,12 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)return 0 ; fb = entry->base.crtc.fb; -vmw_write (dev_priv,SVGA_REG_ENABLE ,0 );vmw_kms_write_svga (dev_priv, w, h, fb->pitch, fb->bits_per_pixel, fb->depth); -vmw_write (dev_priv,SVGA_REG_ENABLE ,1 );return 0 ; } -vmw_write (dev_priv,SVGA_REG_ENABLE ,0 ); -for (i =0 ; i < lds->last_num_active; i++) {vmw_write (dev_priv,SVGA_REG_DISPLAY_ID , i);vmw_write (dev_priv,SVGA_REG_DISPLAY_IS_PRIMARY , !i);
@@ -152,7 +148,6 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)/* Make sure we always show something */ vmw_write (dev_priv,SVGA_REG_NUM_GUEST_DISPLAYS , i ? i :1 ); -vmw_write (dev_priv,SVGA_REG_ENABLE ,1 );BUG_ON (i != lds->num_active);
Signature · 1 line
1.6.2.5
PATCH 10/13 drm/vmwgfx: Some modesetting cleanups and fixes.
From: Jakob Bornecrantz <[email protected]>
--- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 17 ++++------------- 1 files changed, 4 insertions(+), 13 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +4 -13
@@ -113,16 +113,6 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)return 0 ; } -for (i =0 ; i < lds->last_num_active; i++) { -vmw_write (dev_priv,SVGA_REG_DISPLAY_ID , i); -vmw_write (dev_priv,SVGA_REG_DISPLAY_IS_PRIMARY , !i); -vmw_write (dev_priv,SVGA_REG_DISPLAY_POSITION_X ,0 ); -vmw_write (dev_priv,SVGA_REG_DISPLAY_POSITION_Y ,0 ); -vmw_write (dev_priv,SVGA_REG_DISPLAY_WIDTH ,0 ); -vmw_write (dev_priv,SVGA_REG_DISPLAY_HEIGHT ,0 ); -vmw_write (dev_priv,SVGA_REG_DISPLAY_ID ,SVGA_ID_INVALID ); - } -if (!list_empty (&lds->active)) { entry =list_entry (lds->active.next,typeof (*entry), active); fb = entry->base.crtc.fb;
@@ -131,6 +121,10 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv) fb->bits_per_pixel, fb->depth); } +/* Make sure we always show something */ +vmw_write (dev_priv,SVGA_REG_NUM_GUEST_DISPLAYS , + lds->num_active ? lds->num_active :1 ); + i =0 ;list_for_each_entry (entry, &lds->active, active) { crtc = &entry->base.crtc;
@@ -146,9 +140,6 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv) i++; } -/* Make sure we always show something */ -vmw_write (dev_priv,SVGA_REG_NUM_GUEST_DISPLAYS , i ? i :1 ); -BUG_ON (i != lds->num_active); lds->last_num_active = lds->num_active;
Signature · 1 line
1.6.2.5
PATCH 11/13 drm/vmwgfx: Unpause overlay on update.
From: Jakob Bornecrantz <[email protected]>
The unpause codepath uses vmw_overlay_update() so we must unset the paused status.
--- drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c +2 -0
@@ -358,6 +358,8 @@ static int vmw_overlay_update_stream(struct vmw_private *dev_priv,if (stream->buf != buf) stream->buf =vmw_dmabuf_reference (buf); stream->saved = *arg; +/* stream is no longer stopped/paused */ + stream->paused = false;return 0 ; }
Signature · 1 line
1.6.2.5
PATCH 12/13 drm/vmwgfx: Print warnings in kernel log about bo pinning that fails.
From: Jakob Bornecrantz <[email protected]>
--- drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 4 ++++ drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 ++ 2 files changed, 6 insertions(+), 0 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +4 -0
@@ -624,6 +624,10 @@ int vmw_dmabuf_to_start_of_vram(struct vmw_private *vmw_priv, goto err_unlock; ret =ttm_bo_validate (bo, &ne_placement, false, false); + +/* Could probably bug on */ +WARN_ON (bo->offset !=0 ); +ttm_bo_unreserve (bo); err_unlock:ttm_write_unlock (&vmw_priv->active_master->lock);
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +2 -0
@@ -638,6 +638,8 @@ static int vmw_framebuffer_dmabuf_pin(struct vmw_framebuffer *vfb)vmw_overlay_resume_all (dev_priv); +WARN_ON (ret !=0 ); +return 0 ; }
Signature · 1 line
1.6.2.5
PATCH 13/13 drm/vmwgfx: Remove some leftover debug messages.
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +0 -8
@@ -408,8 +408,6 @@ static int vmw_driver_unload(struct drm_device *dev) {struct vmw_private *dev_priv =vmw_priv (dev); -DRM_INFO (VMWGFX_DRIVER_NAME " unload.\n" ); -unregister_pm_notifier (&dev_priv->pm_nb);vmw_fb_close (dev_priv);
@@ -555,7 +553,6 @@ static int vmw_master_create(struct drm_device *dev, {struct vmw_master *vmaster; -DRM_INFO ("Master create.\n" ); vmaster =kzalloc (sizeof (*vmaster),GFP_KERNEL );if (unlikely (vmaster ==NULL ))return -ENOMEM ;
@@ -572,7 +569,6 @@ static void vmw_master_destroy(struct drm_device *dev, {struct vmw_master *vmaster =vmw_master (master); -DRM_INFO ("Master destroy.\n" ); master->driver_priv =NULL ;kfree (vmaster); }
@@ -588,8 +584,6 @@ static int vmw_master_set(struct drm_device *dev,struct vmw_master *vmaster =vmw_master (file_priv->master);int ret =0 ; -DRM_INFO ("Master set.\n" ); -if (active) {BUG_ON (active != &dev_priv->fbdev_master); ret =ttm_vt_lock (&active->lock, false, vmw_fp->tfile);
@@ -631,8 +625,6 @@ static void vmw_master_drop(struct drm_device *dev,struct vmw_master *vmaster =vmw_master (file_priv->master);int ret; -DRM_INFO ("Master drop.\n" ); -/** * Make sure the master doesn't disappear while we have * it locked.
Signature · 1 line
1.6.2.5
Re: [PATCH 02/13] drm/vmwgfx: Fix single framebuffer detection.
In reply to Thomas HellstromQuoted 13 lines · Thomas Hellstrom
From: Jakob Bornecrantz<[email protected]>
Signed-off-by Jakob Bornecrantz<[email protected]>Signed-off-by Thomas Hellstrom<[email protected]>--- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +0
-0
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c static int vmw_ldu_del_active(struct vmw_private *vmw_priv, · line 133
Quoted 4 lines
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +1
-0@@ -130,6 +130,7 @@ static int vmw_ldu_del_active(struct vmw_private *vmw_priv,if (list_empty (&ldu->active))return 0 ; +/* must init otherwise list_empty(&ldu->active) well not work */
Spelling well->will
Quoted 12 lines
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +2
-0list_del_init (&ldu->active);if (--(ld->num_active) ==0 ) {BUG_ON (!ld->fb);@@ -208,6 +209,8 @@ static int vmw_ldu_crtc_set_config(struct drm_mode_set *set)/* ldu only supports one fb active at the time */ if (dev_priv->ldu_priv->fb&& vfb&& + !(dev_priv->ldu_priv->num_active ==1 && + !list_empty (&ldu->active))&& dev_priv->ldu_priv->fb != vfb) {DRM_ERROR ("Multiple framebuffers not supported\n" );return -EINVAL ;