Commit 231f42a4 authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: move dri1 dungeon out of dev_priv

Also, move dev_priv->counter there, it's only used in i915_dma.c

And also move the dri1 dungeon at the end of dev_priv where no one
cares about it.
Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 3e373948
...@@ -451,16 +451,16 @@ static void i915_emit_breadcrumb(struct drm_device *dev) ...@@ -451,16 +451,16 @@ static void i915_emit_breadcrumb(struct drm_device *dev)
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv;
dev_priv->counter++; dev_priv->dri1.counter++;
if (dev_priv->counter > 0x7FFFFFFFUL) if (dev_priv->dri1.counter > 0x7FFFFFFFUL)
dev_priv->counter = 0; dev_priv->dri1.counter = 0;
if (master_priv->sarea_priv) if (master_priv->sarea_priv)
master_priv->sarea_priv->last_enqueue = dev_priv->counter; master_priv->sarea_priv->last_enqueue = dev_priv->dri1.counter;
if (BEGIN_LP_RING(4) == 0) { if (BEGIN_LP_RING(4) == 0) {
OUT_RING(MI_STORE_DWORD_INDEX); OUT_RING(MI_STORE_DWORD_INDEX);
OUT_RING(I915_BREADCRUMB_INDEX << MI_STORE_DWORD_INDEX_SHIFT); OUT_RING(I915_BREADCRUMB_INDEX << MI_STORE_DWORD_INDEX_SHIFT);
OUT_RING(dev_priv->counter); OUT_RING(dev_priv->dri1.counter);
OUT_RING(0); OUT_RING(0);
ADVANCE_LP_RING(); ADVANCE_LP_RING();
} }
...@@ -602,12 +602,12 @@ static int i915_dispatch_flip(struct drm_device * dev) ...@@ -602,12 +602,12 @@ static int i915_dispatch_flip(struct drm_device * dev)
ADVANCE_LP_RING(); ADVANCE_LP_RING();
master_priv->sarea_priv->last_enqueue = dev_priv->counter++; master_priv->sarea_priv->last_enqueue = dev_priv->dri1.counter++;
if (BEGIN_LP_RING(4) == 0) { if (BEGIN_LP_RING(4) == 0) {
OUT_RING(MI_STORE_DWORD_INDEX); OUT_RING(MI_STORE_DWORD_INDEX);
OUT_RING(I915_BREADCRUMB_INDEX << MI_STORE_DWORD_INDEX_SHIFT); OUT_RING(I915_BREADCRUMB_INDEX << MI_STORE_DWORD_INDEX_SHIFT);
OUT_RING(dev_priv->counter); OUT_RING(dev_priv->dri1.counter);
OUT_RING(0); OUT_RING(0);
ADVANCE_LP_RING(); ADVANCE_LP_RING();
} }
...@@ -775,21 +775,21 @@ static int i915_emit_irq(struct drm_device * dev) ...@@ -775,21 +775,21 @@ static int i915_emit_irq(struct drm_device * dev)
DRM_DEBUG_DRIVER("\n"); DRM_DEBUG_DRIVER("\n");
dev_priv->counter++; dev_priv->dri1.counter++;
if (dev_priv->counter > 0x7FFFFFFFUL) if (dev_priv->dri1.counter > 0x7FFFFFFFUL)
dev_priv->counter = 1; dev_priv->dri1.counter = 1;
if (master_priv->sarea_priv) if (master_priv->sarea_priv)
master_priv->sarea_priv->last_enqueue = dev_priv->counter; master_priv->sarea_priv->last_enqueue = dev_priv->dri1.counter;
if (BEGIN_LP_RING(4) == 0) { if (BEGIN_LP_RING(4) == 0) {
OUT_RING(MI_STORE_DWORD_INDEX); OUT_RING(MI_STORE_DWORD_INDEX);
OUT_RING(I915_BREADCRUMB_INDEX << MI_STORE_DWORD_INDEX_SHIFT); OUT_RING(I915_BREADCRUMB_INDEX << MI_STORE_DWORD_INDEX_SHIFT);
OUT_RING(dev_priv->counter); OUT_RING(dev_priv->dri1.counter);
OUT_RING(MI_USER_INTERRUPT); OUT_RING(MI_USER_INTERRUPT);
ADVANCE_LP_RING(); ADVANCE_LP_RING();
} }
return dev_priv->counter; return dev_priv->dri1.counter;
} }
static int i915_wait_irq(struct drm_device * dev, int irq_nr) static int i915_wait_irq(struct drm_device * dev, int irq_nr)
...@@ -820,7 +820,7 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr) ...@@ -820,7 +820,7 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr)
if (ret == -EBUSY) { if (ret == -EBUSY) {
DRM_ERROR("EBUSY -- rec: %d emitted: %d\n", DRM_ERROR("EBUSY -- rec: %d emitted: %d\n",
READ_BREADCRUMB(dev_priv), (int)dev_priv->counter); READ_BREADCRUMB(dev_priv), (int)dev_priv->dri1.counter);
} }
return ret; return ret;
......
...@@ -586,6 +586,19 @@ struct intel_ilk_power_mgmt { ...@@ -586,6 +586,19 @@ struct intel_ilk_power_mgmt {
struct drm_i915_gem_object *renderctx; struct drm_i915_gem_object *renderctx;
}; };
struct i915_dri1_state {
unsigned allow_batchbuffer : 1;
u32 __iomem *gfx_hws_cpu_addr;
unsigned int cpp;
int back_offset;
int front_offset;
int current_page;
int page_flipping;
uint32_t counter;
};
typedef struct drm_i915_private { typedef struct drm_i915_private {
struct drm_device *dev; struct drm_device *dev;
...@@ -620,7 +633,6 @@ typedef struct drm_i915_private { ...@@ -620,7 +633,6 @@ typedef struct drm_i915_private {
uint32_t next_seqno; uint32_t next_seqno;
drm_dma_handle_t *status_page_dmah; drm_dma_handle_t *status_page_dmah;
uint32_t counter;
struct resource mch_res; struct resource mch_res;
atomic_t irq_received; atomic_t irq_received;
...@@ -827,19 +839,6 @@ typedef struct drm_i915_private { ...@@ -827,19 +839,6 @@ typedef struct drm_i915_private {
u32 object_count; u32 object_count;
} mm; } mm;
/* Old dri1 support infrastructure, beware the dragons ya fools entering
* here! */
struct {
unsigned allow_batchbuffer : 1;
u32 __iomem *gfx_hws_cpu_addr;
unsigned int cpp;
int back_offset;
int front_offset;
int current_page;
int page_flipping;
} dri1;
/* Kernel Modesetting */ /* Kernel Modesetting */
struct sdvo_device_mapping sdvo_mappings[2]; struct sdvo_device_mapping sdvo_mappings[2];
...@@ -893,6 +892,10 @@ typedef struct drm_i915_private { ...@@ -893,6 +892,10 @@ typedef struct drm_i915_private {
uint32_t hw_context_size; uint32_t hw_context_size;
struct i915_suspend_saved_registers regfile; struct i915_suspend_saved_registers regfile;
/* Old dri1 support infrastructure, beware the dragons ya fools entering
* here! */
struct i915_dri1_state dri1;
} drm_i915_private_t; } drm_i915_private_t;
/* Iterate over initialised rings */ /* Iterate over initialised rings */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment