Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269581
b: refs/heads/master
c: 6bcd8d3
h: refs/heads/master
i:
  269579: 57818c7
v: v3
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Sep 6, 2011
1 parent b9c756e commit e78ec5f
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 113 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f63f6a59d3905ac73aeeb617b27ac31516549ed9
refs/heads/master: 6bcd8d3c782b7b2c98c8f414a6bb43cf6b84e53c
2 changes: 1 addition & 1 deletion trunk/drivers/gpu/drm/vmwgfx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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_fence.o vmwgfx_gmrid_manager.o
vmwgfx_overlay.o vmwgfx_marker.o vmwgfx_gmrid_manager.o

obj-$(CONFIG_DRM_VMWGFX) := vmwgfx.o
8 changes: 4 additions & 4 deletions trunk/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,18 +295,18 @@ static int vmw_sync_obj_flush(void *sync_obj, void *sync_arg)
static bool vmw_sync_obj_signaled(void *sync_obj, void *sync_arg)
{
struct vmw_private *dev_priv = (struct vmw_private *)sync_arg;
uint32_t sequence = (unsigned long) sync_obj;
uint32_t seqno = (unsigned long) sync_obj;

return vmw_fence_signaled(dev_priv, sequence);
return vmw_seqno_passed(dev_priv, seqno);
}

static int vmw_sync_obj_wait(void *sync_obj, void *sync_arg,
bool lazy, bool interruptible)
{
struct vmw_private *dev_priv = (struct vmw_private *)sync_arg;
uint32_t sequence = (unsigned long) sync_obj;
uint32_t seqno = (unsigned long) sync_obj;

return vmw_wait_fence(dev_priv, false, sequence, false, 3*HZ);
return vmw_wait_seqno(dev_priv, false, seqno, false, 3*HZ);
}

struct ttm_bo_driver vmw_bo_driver = {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)

dev_priv->dev = dev;
dev_priv->vmw_chipset = chipset;
dev_priv->last_read_sequence = (uint32_t) -100;
dev_priv->last_read_seqno = (uint32_t) -100;
mutex_init(&dev_priv->hw_mutex);
mutex_init(&dev_priv->cmdbuf_mutex);
mutex_init(&dev_priv->release_mutex);
Expand Down
42 changes: 21 additions & 21 deletions trunk/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct vmw_surface {
struct vmw_cursor_snooper snooper;
};

struct vmw_fence_queue {
struct vmw_marker_queue {
struct list_head head;
struct timespec lag;
struct timespec lag_time;
Expand All @@ -121,7 +121,7 @@ struct vmw_fifo_state {
uint32_t capabilities;
struct mutex fifo_mutex;
struct rw_semaphore rwsem;
struct vmw_fence_queue fence_queue;
struct vmw_marker_queue marker_queue;
};

struct vmw_relocation {
Expand Down Expand Up @@ -238,12 +238,12 @@ struct vmw_private {
* Fencing and IRQs.
*/

atomic_t fence_seq;
atomic_t marker_seq;
wait_queue_head_t fence_queue;
wait_queue_head_t fifo_queue;
atomic_t fence_queue_waiters;
atomic_t fifo_queue_waiters;
uint32_t last_read_sequence;
uint32_t last_read_seqno;
spinlock_t irq_lock;

/*
Expand Down Expand Up @@ -411,7 +411,7 @@ extern void vmw_fifo_release(struct vmw_private *dev_priv,
extern void *vmw_fifo_reserve(struct vmw_private *dev_priv, uint32_t bytes);
extern void vmw_fifo_commit(struct vmw_private *dev_priv, uint32_t bytes);
extern int vmw_fifo_send_fence(struct vmw_private *dev_priv,
uint32_t *sequence);
uint32_t *seqno);
extern void vmw_fifo_ping_host(struct vmw_private *dev_priv, uint32_t reason);
extern bool vmw_fifo_have_3d(struct vmw_private *dev_priv);
extern bool vmw_fifo_have_pitchlock(struct vmw_private *dev_priv);
Expand Down Expand Up @@ -448,39 +448,39 @@ extern int vmw_execbuf_ioctl(struct drm_device *dev, void *data,
*/

extern irqreturn_t vmw_irq_handler(DRM_IRQ_ARGS);
extern int vmw_wait_fence(struct vmw_private *dev_priv, bool lazy,
uint32_t sequence, bool interruptible,
unsigned long timeout);
extern int vmw_wait_seqno(struct vmw_private *dev_priv, bool lazy,
uint32_t seqno, bool interruptible,
unsigned long timeout);
extern void vmw_irq_preinstall(struct drm_device *dev);
extern int vmw_irq_postinstall(struct drm_device *dev);
extern void vmw_irq_uninstall(struct drm_device *dev);
extern bool vmw_fence_signaled(struct vmw_private *dev_priv,
uint32_t sequence);
extern bool vmw_seqno_passed(struct vmw_private *dev_priv,
uint32_t seqno);
extern int vmw_fence_wait_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
extern int vmw_fallback_wait(struct vmw_private *dev_priv,
bool lazy,
bool fifo_idle,
uint32_t sequence,
uint32_t seqno,
bool interruptible,
unsigned long timeout);
extern void vmw_update_sequence(struct vmw_private *dev_priv,
extern void vmw_update_seqno(struct vmw_private *dev_priv,
struct vmw_fifo_state *fifo_state);


/**
* Rudimentary fence objects currently used only for throttling -
* vmwgfx_fence.c
* Rudimentary fence-like objects currently used only for throttling -
* vmwgfx_marker.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 void vmw_marker_queue_init(struct vmw_marker_queue *queue);
extern void vmw_marker_queue_takedown(struct vmw_marker_queue *queue);
extern int vmw_marker_push(struct vmw_marker_queue *queue,
uint32_t seqno);
extern int vmw_marker_pull(struct vmw_marker_queue *queue,
uint32_t signaled_seqno);
extern int vmw_wait_lag(struct vmw_private *dev_priv,
struct vmw_fence_queue *queue, uint32_t us);
struct vmw_marker_queue *queue, uint32_t us);

/**
* Kernel framebuffer - vmwgfx_fb.c
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ int vmw_execbuf_ioctl(struct drm_device *dev, void *data,
int ret;
void *user_cmd;
void *cmd;
uint32_t sequence;
uint32_t seqno;
struct vmw_sw_context *sw_context = &dev_priv->ctx;
struct vmw_master *vmaster = vmw_master(file_priv->master);

Expand Down Expand Up @@ -738,7 +738,7 @@ int vmw_execbuf_ioctl(struct drm_device *dev, void *data,
vmw_apply_relocations(sw_context);

if (arg->throttle_us) {
ret = vmw_wait_lag(dev_priv, &dev_priv->fifo.fence_queue,
ret = vmw_wait_lag(dev_priv, &dev_priv->fifo.marker_queue,
arg->throttle_us);

if (unlikely(ret != 0))
Expand All @@ -755,10 +755,10 @@ int vmw_execbuf_ioctl(struct drm_device *dev, void *data,
memcpy(cmd, sw_context->cmd_bounce, arg->command_size);
vmw_fifo_commit(dev_priv, arg->command_size);

ret = vmw_fifo_send_fence(dev_priv, &sequence);
ret = vmw_fifo_send_fence(dev_priv, &seqno);

ttm_eu_fence_buffer_objects(&sw_context->validate_nodes,
(void *)(unsigned long) sequence);
(void *)(unsigned long) seqno);
vmw_clear_validations(sw_context);
mutex_unlock(&dev_priv->cmdbuf_mutex);

Expand All @@ -771,7 +771,7 @@ int vmw_execbuf_ioctl(struct drm_device *dev, void *data,
DRM_ERROR("Fence submission error. Syncing.\n");

fence_rep.error = ret;
fence_rep.fence_seq = (uint64_t) sequence;
fence_rep.fence_seq = (uint64_t) seqno;
fence_rep.pad64 = 0;

user_fence_rep = (struct drm_vmw_fence_rep __user *)
Expand Down
26 changes: 13 additions & 13 deletions trunk/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ int vmw_fifo_init(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo)
(unsigned int) min,
(unsigned int) fifo->capabilities);

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);
atomic_set(&dev_priv->marker_seq, dev_priv->last_read_seqno);
iowrite32(dev_priv->last_read_seqno, fifo_mem + SVGA_FIFO_FENCE);
vmw_marker_queue_init(&fifo->marker_queue);
return vmw_fifo_send_fence(dev_priv, &dummy);
}

Expand All @@ -156,7 +156,7 @@ void vmw_fifo_release(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo)
while (vmw_read(dev_priv, SVGA_REG_BUSY) != 0)
vmw_write(dev_priv, SVGA_REG_SYNC, SVGA_SYNC_GENERIC);

dev_priv->last_read_sequence = ioread32(fifo_mem + SVGA_FIFO_FENCE);
dev_priv->last_read_seqno = ioread32(fifo_mem + SVGA_FIFO_FENCE);

vmw_write(dev_priv, SVGA_REG_CONFIG_DONE,
dev_priv->config_done_state);
Expand All @@ -166,7 +166,7 @@ void vmw_fifo_release(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo)
dev_priv->traces_state);

mutex_unlock(&dev_priv->hw_mutex);
vmw_fence_queue_takedown(&fifo->fence_queue);
vmw_marker_queue_takedown(&fifo->marker_queue);

if (likely(fifo->static_buffer != NULL)) {
vfree(fifo->static_buffer);
Expand Down Expand Up @@ -447,7 +447,7 @@ void vmw_fifo_commit(struct vmw_private *dev_priv, uint32_t bytes)
mutex_unlock(&fifo_state->fifo_mutex);
}

int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *sequence)
int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *seqno)
{
struct vmw_fifo_state *fifo_state = &dev_priv->fifo;
struct svga_fifo_cmd_fence *cmd_fence;
Expand All @@ -457,16 +457,16 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *sequence)

fm = vmw_fifo_reserve(dev_priv, bytes);
if (unlikely(fm == NULL)) {
*sequence = atomic_read(&dev_priv->fence_seq);
*seqno = atomic_read(&dev_priv->marker_seq);
ret = -ENOMEM;
(void)vmw_fallback_wait(dev_priv, false, true, *sequence,
(void)vmw_fallback_wait(dev_priv, false, true, *seqno,
false, 3*HZ);
goto out_err;
}

do {
*sequence = atomic_add_return(1, &dev_priv->fence_seq);
} while (*sequence == 0);
*seqno = atomic_add_return(1, &dev_priv->marker_seq);
} while (*seqno == 0);

if (!(fifo_state->capabilities & SVGA_FIFO_CAP_FENCE)) {

Expand All @@ -483,10 +483,10 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *sequence)
cmd_fence = (struct svga_fifo_cmd_fence *)
((unsigned long)fm + sizeof(__le32));

iowrite32(*sequence, &cmd_fence->fence);
iowrite32(*seqno, &cmd_fence->fence);
vmw_fifo_commit(dev_priv, bytes);
(void) vmw_fence_push(&fifo_state->fence_queue, *sequence);
vmw_update_sequence(dev_priv, fifo_state);
(void) vmw_marker_push(&fifo_state->marker_queue, *seqno);
vmw_update_seqno(dev_priv, fifo_state);

out_err:
return ret;
Expand Down
Loading

0 comments on commit e78ec5f

Please sign in to comment.