Skip to content

Commit

Permalink
drm/i915: Rename dev_priv->ring to dev_priv->render_ring.
Browse files Browse the repository at this point in the history
With the advent of the BSD ring, be clear about which ring this is.
The docs are pretty consistent with calling this the Render engine at
this point.
  • Loading branch information
anholt committed May 26, 2010
1 parent 62fdfea commit d3301d8
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 55 deletions.
8 changes: 4 additions & 4 deletions drivers/gpu/drm/i915/i915_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,14 @@ static int i915_ringbuffer_data(struct seq_file *m, void *data)
u8 *virt;
uint32_t *ptr, off;

if (!dev_priv->ring.ring_obj) {
if (!dev_priv->render_ring.ring_obj) {
seq_printf(m, "No ringbuffer setup\n");
return 0;
}

virt = dev_priv->ring.virtual_start;
virt = dev_priv->render_ring.virtual_start;

for (off = 0; off < dev_priv->ring.Size; off += 4) {
for (off = 0; off < dev_priv->render_ring.Size; off += 4) {
ptr = (uint32_t *)(virt + off);
seq_printf(m, "%08x : %08x\n", off, *ptr);
}
Expand All @@ -344,7 +344,7 @@ static int i915_ringbuffer_info(struct seq_file *m, void *data)

seq_printf(m, "RingHead : %08x\n", head);
seq_printf(m, "RingTail : %08x\n", tail);
seq_printf(m, "RingSize : %08lx\n", dev_priv->ring.Size);
seq_printf(m, "RingSize : %08lx\n", dev_priv->render_ring.Size);
seq_printf(m, "Acthd : %08x\n", I915_READ(IS_I965G(dev) ? ACTHD_I965 : ACTHD));

return 0;
Expand Down
38 changes: 19 additions & 19 deletions drivers/gpu/drm/i915/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void i915_kernel_lost_context(struct drm_device * dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct drm_i915_master_private *master_priv;
drm_i915_ring_buffer_t *ring = &(dev_priv->ring);
drm_i915_ring_buffer_t *ring = &(dev_priv->render_ring);

/*
* We should never lose context on the ring with modesetting
Expand Down Expand Up @@ -128,11 +128,11 @@ static int i915_dma_cleanup(struct drm_device * dev)
if (dev->irq_enabled)
drm_irq_uninstall(dev);

if (dev_priv->ring.virtual_start) {
drm_core_ioremapfree(&dev_priv->ring.map, dev);
dev_priv->ring.virtual_start = NULL;
dev_priv->ring.map.handle = NULL;
dev_priv->ring.map.size = 0;
if (dev_priv->render_ring.virtual_start) {
drm_core_ioremapfree(&dev_priv->render_ring.map, dev);
dev_priv->render_ring.virtual_start = NULL;
dev_priv->render_ring.map.handle = NULL;
dev_priv->render_ring.map.size = 0;
}

/* Clear the HWS virtual address at teardown */
Expand All @@ -156,32 +156,32 @@ static int i915_initialize(struct drm_device * dev, drm_i915_init_t * init)
}

if (init->ring_size != 0) {
if (dev_priv->ring.ring_obj != NULL) {
if (dev_priv->render_ring.ring_obj != NULL) {
i915_dma_cleanup(dev);
DRM_ERROR("Client tried to initialize ringbuffer in "
"GEM mode\n");
return -EINVAL;
}

dev_priv->ring.Size = init->ring_size;
dev_priv->render_ring.Size = init->ring_size;

dev_priv->ring.map.offset = init->ring_start;
dev_priv->ring.map.size = init->ring_size;
dev_priv->ring.map.type = 0;
dev_priv->ring.map.flags = 0;
dev_priv->ring.map.mtrr = 0;
dev_priv->render_ring.map.offset = init->ring_start;
dev_priv->render_ring.map.size = init->ring_size;
dev_priv->render_ring.map.type = 0;
dev_priv->render_ring.map.flags = 0;
dev_priv->render_ring.map.mtrr = 0;

drm_core_ioremap_wc(&dev_priv->ring.map, dev);
drm_core_ioremap_wc(&dev_priv->render_ring.map, dev);

if (dev_priv->ring.map.handle == NULL) {
if (dev_priv->render_ring.map.handle == NULL) {
i915_dma_cleanup(dev);
DRM_ERROR("can not ioremap virtual address for"
" ring buffer\n");
return -ENOMEM;
}
}

dev_priv->ring.virtual_start = dev_priv->ring.map.handle;
dev_priv->render_ring.virtual_start = dev_priv->render_ring.map.handle;

dev_priv->cpp = init->cpp;
dev_priv->back_offset = init->back_offset;
Expand All @@ -203,7 +203,7 @@ static int i915_dma_resume(struct drm_device * dev)

DRM_DEBUG_DRIVER("%s\n", __func__);

if (dev_priv->ring.map.handle == NULL) {
if (dev_priv->render_ring.map.handle == NULL) {
DRM_ERROR("can not ioremap virtual address for"
" ring buffer\n");
return -ENOMEM;
Expand Down Expand Up @@ -332,7 +332,7 @@ static int i915_emit_cmds(struct drm_device * dev, int *buffer, int dwords)
int i;
RING_LOCALS;

if ((dwords+1) * sizeof(int) >= dev_priv->ring.Size - 8)
if ((dwords+1) * sizeof(int) >= dev_priv->render_ring.Size - 8)
return -EINVAL;

BEGIN_LP_RING((dwords+1)&~1);
Expand Down Expand Up @@ -563,7 +563,7 @@ static int i915_quiescent(struct drm_device * dev)
drm_i915_private_t *dev_priv = dev->dev_private;

i915_kernel_lost_context(dev);
return i915_wait_ring(dev, dev_priv->ring.Size - 8, __func__);
return i915_wait_ring(dev, dev_priv->render_ring.Size - 8, __func__);
}

static int i915_flush_ioctl(struct drm_device *dev, void *data,
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ int i965_reset(struct drm_device *dev, u8 flags)
*/
if (drm_core_check_feature(dev, DRIVER_MODESET) ||
!dev_priv->mm.suspended) {
drm_i915_ring_buffer_t *ring = &dev_priv->ring;
drm_i915_ring_buffer_t *ring = &dev_priv->render_ring;
struct drm_gem_object *obj = ring->ring_obj;
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
dev_priv->mm.suspended = 0;
Expand Down
20 changes: 10 additions & 10 deletions drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ typedef struct drm_i915_private {
void __iomem *regs;

struct pci_dev *bridge_dev;
drm_i915_ring_buffer_t ring;
drm_i915_ring_buffer_t render_ring;

drm_dma_handle_t *status_page_dmah;
void *hw_status_page;
Expand Down Expand Up @@ -1044,7 +1044,7 @@ extern int intel_trans_dp_port_sel (struct drm_crtc *crtc);
* has access to the ring.
*/
#define RING_LOCK_TEST_WITH_RETURN(dev, file_priv) do { \
if (((drm_i915_private_t *)dev->dev_private)->ring.ring_obj == NULL) \
if (((drm_i915_private_t *)dev->dev_private)->render_ring.ring_obj == NULL) \
LOCK_TEST_WITH_RETURN(dev, file_priv); \
} while (0)

Expand All @@ -1066,15 +1066,15 @@ extern int intel_trans_dp_port_sel (struct drm_crtc *crtc);
int bytes__ = 4*(n); \
if (I915_VERBOSE) DRM_DEBUG("BEGIN_LP_RING(%d)\n", (n)); \
/* a wrap must occur between instructions so pad beforehand */ \
if (unlikely (dev_priv->ring.tail + bytes__ > dev_priv->ring.Size)) \
if (unlikely (dev_priv->render_ring.tail + bytes__ > dev_priv->render_ring.Size)) \
i915_wrap_ring(dev); \
if (unlikely (dev_priv->ring.space < bytes__)) \
if (unlikely (dev_priv->render_ring.space < bytes__)) \
i915_wait_ring(dev, bytes__, __func__); \
ring_virt__ = (unsigned int *) \
(dev_priv->ring.virtual_start + dev_priv->ring.tail); \
dev_priv->ring.tail += bytes__; \
dev_priv->ring.tail &= dev_priv->ring.Size - 1; \
dev_priv->ring.space -= bytes__; \
(dev_priv->render_ring.virtual_start + dev_priv->render_ring.tail); \
dev_priv->render_ring.tail += bytes__; \
dev_priv->render_ring.tail &= dev_priv->render_ring.Size - 1; \
dev_priv->render_ring.space -= bytes__; \
} while (0)

#define OUT_RING(n) do { \
Expand All @@ -1084,8 +1084,8 @@ extern int intel_trans_dp_port_sel (struct drm_crtc *crtc);

#define ADVANCE_LP_RING() do { \
if (I915_VERBOSE) \
DRM_DEBUG("ADVANCE_LP_RING %x\n", dev_priv->ring.tail); \
I915_WRITE(PRB0_TAIL, dev_priv->ring.tail); \
DRM_DEBUG("ADVANCE_LP_RING %x\n", dev_priv->render_ring.tail); \
I915_WRITE(PRB0_TAIL, dev_priv->render_ring.tail); \
} while(0)

/**
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -4378,7 +4378,7 @@ i915_gem_idle(struct drm_device *dev)

mutex_lock(&dev->struct_mutex);

if (dev_priv->mm.suspended || dev_priv->ring.ring_obj == NULL) {
if (dev_priv->mm.suspended || dev_priv->render_ring.ring_obj == NULL) {
mutex_unlock(&dev->struct_mutex);
return 0;
}
Expand Down
12 changes: 6 additions & 6 deletions drivers/gpu/drm/i915/i915_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,17 +536,17 @@ i915_ringbuffer_last_batch(struct drm_device *dev)
*/
bbaddr = 0;
head = I915_READ(PRB0_HEAD) & HEAD_ADDR;
ring = (u32 *)(dev_priv->ring.virtual_start + head);
ring = (u32 *)(dev_priv->render_ring.virtual_start + head);

while (--ring >= (u32 *)dev_priv->ring.virtual_start) {
while (--ring >= (u32 *)dev_priv->render_ring.virtual_start) {
bbaddr = i915_get_bbaddr(dev, ring);
if (bbaddr)
break;
}

if (bbaddr == 0) {
ring = (u32 *)(dev_priv->ring.virtual_start + dev_priv->ring.Size);
while (--ring >= (u32 *)dev_priv->ring.virtual_start) {
ring = (u32 *)(dev_priv->render_ring.virtual_start + dev_priv->render_ring.Size);
while (--ring >= (u32 *)dev_priv->render_ring.virtual_start) {
bbaddr = i915_get_bbaddr(dev, ring);
if (bbaddr)
break;
Expand Down Expand Up @@ -639,7 +639,7 @@ static void i915_capture_error_state(struct drm_device *dev)
error->batchbuffer[1] = i915_error_object_create(dev, batchbuffer[1]);

/* Record the ringbuffer */
error->ringbuffer = i915_error_object_create(dev, dev_priv->ring.ring_obj);
error->ringbuffer = i915_error_object_create(dev, dev_priv->render_ring.ring_obj);

/* Record buffers on the active list. */
error->active_bo = NULL;
Expand Down Expand Up @@ -1056,7 +1056,7 @@ int i915_irq_emit(struct drm_device *dev, void *data,
drm_i915_irq_emit_t *emit = data;
int result;

if (!dev_priv || !dev_priv->ring.virtual_start) {
if (!dev_priv || !dev_priv->render_ring.virtual_start) {
DRM_ERROR("called with no initialization\n");
return -EINVAL;
}
Expand Down
28 changes: 14 additions & 14 deletions drivers/gpu/drm/i915/intel_ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ i915_gem_init_ringbuffer(struct drm_device *dev)
drm_i915_private_t *dev_priv = dev->dev_private;
struct drm_gem_object *obj;
struct drm_i915_gem_object *obj_priv;
drm_i915_ring_buffer_t *ring = &dev_priv->ring;
drm_i915_ring_buffer_t *ring = &dev_priv->render_ring;
int ret;
u32 head;

Expand Down Expand Up @@ -403,7 +403,7 @@ i915_gem_init_ringbuffer(struct drm_device *dev)
drm_core_ioremap_wc(&ring->map, dev);
if (ring->map.handle == NULL) {
DRM_ERROR("Failed to map ringbuffer.\n");
memset(&dev_priv->ring, 0, sizeof(dev_priv->ring));
memset(&dev_priv->render_ring, 0, sizeof(dev_priv->render_ring));
i915_gem_object_unpin(obj);
drm_gem_object_unreference(obj);
i915_gem_cleanup_hws(dev);
Expand Down Expand Up @@ -481,15 +481,15 @@ i915_gem_cleanup_ringbuffer(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;

if (dev_priv->ring.ring_obj == NULL)
if (dev_priv->render_ring.ring_obj == NULL)
return;

drm_core_ioremapfree(&dev_priv->ring.map, dev);
drm_core_ioremapfree(&dev_priv->render_ring.map, dev);

i915_gem_object_unpin(dev_priv->ring.ring_obj);
drm_gem_object_unreference(dev_priv->ring.ring_obj);
dev_priv->ring.ring_obj = NULL;
memset(&dev_priv->ring, 0, sizeof(dev_priv->ring));
i915_gem_object_unpin(dev_priv->render_ring.ring_obj);
drm_gem_object_unreference(dev_priv->render_ring.ring_obj);
dev_priv->render_ring.ring_obj = NULL;
memset(&dev_priv->render_ring, 0, sizeof(dev_priv->render_ring));

i915_gem_cleanup_hws(dev);
}
Expand All @@ -503,29 +503,29 @@ int i915_wrap_ring(struct drm_device *dev)
volatile unsigned int *virt;
int rem;

rem = dev_priv->ring.Size - dev_priv->ring.tail;
if (dev_priv->ring.space < rem) {
rem = dev_priv->render_ring.Size - dev_priv->render_ring.tail;
if (dev_priv->render_ring.space < rem) {
int ret = i915_wait_ring(dev, rem, __func__);
if (ret)
return ret;
}
dev_priv->ring.space -= rem;
dev_priv->render_ring.space -= rem;

virt = (unsigned int *)
(dev_priv->ring.virtual_start + dev_priv->ring.tail);
(dev_priv->render_ring.virtual_start + dev_priv->render_ring.tail);
rem /= 4;
while (rem--)
*virt++ = MI_NOOP;

dev_priv->ring.tail = 0;
dev_priv->render_ring.tail = 0;

return 0;
}

int i915_wait_ring(struct drm_device * dev, int n, const char *caller)
{
drm_i915_private_t *dev_priv = dev->dev_private;
drm_i915_ring_buffer_t *ring = &(dev_priv->ring);
drm_i915_ring_buffer_t *ring = &(dev_priv->render_ring);
u32 acthd_reg = IS_I965G(dev) ? ACTHD_I965 : ACTHD;
u32 last_acthd = I915_READ(acthd_reg);
u32 acthd;
Expand Down

0 comments on commit d3301d8

Please sign in to comment.