summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.c
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2010-09-16 10:43:11 +0800
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-21 11:19:55 +0100
commit5c1143bbecf50184ff7cad6287b4e0993bacbd9f (patch)
treefeccbd785e3dd4331539f7d0146022eb2806b013 /drivers/gpu/drm/i915/intel_ringbuffer.c
parent92f49d9cec0052e09d938ac913d8e9ab432a0584 (diff)
drm/i915: do not export the instances of struct intel_ring_buffer
Introduce intel_init_render_ring_buffer(), intel_init_bsd_ring_buffer for ring initialization. Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 45f66e289af..178e2cea983 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -793,7 +793,7 @@ void intel_fill_struct(struct drm_device *dev,
intel_ring_advance(dev, ring);
}
-struct intel_ring_buffer render_ring = {
+static struct intel_ring_buffer render_ring = {
.name = "render ring",
.id = RING_RENDER,
.regs = {
@@ -831,7 +831,7 @@ struct intel_ring_buffer render_ring = {
/* ring buffer for bit-stream decoder */
-struct intel_ring_buffer bsd_ring = {
+static struct intel_ring_buffer bsd_ring = {
.name = "bsd ring",
.id = RING_BSD,
.regs = {
@@ -866,3 +866,28 @@ struct intel_ring_buffer bsd_ring = {
.status_page = {NULL, 0, NULL},
.map = {0,}
};
+
+int intel_init_render_ring_buffer(struct drm_device *dev)
+{
+ drm_i915_private_t *dev_priv = dev->dev_private;
+
+ dev_priv->render_ring = render_ring;
+
+ if (!I915_NEED_GFX_HWS(dev)) {
+ dev_priv->render_ring.status_page.page_addr
+ = dev_priv->status_page_dmah->vaddr;
+ memset(dev_priv->render_ring.status_page.page_addr,
+ 0, PAGE_SIZE);
+ }
+
+ return intel_init_ring_buffer(dev, &dev_priv->render_ring);
+}
+
+int intel_init_bsd_ring_buffer(struct drm_device *dev)
+{
+ drm_i915_private_t *dev_priv = dev->dev_private;
+
+ dev_priv->bsd_ring = bsd_ring;
+
+ return intel_init_ring_buffer(dev, &dev_priv->bsd_ring);
+}