@@ -1347,9 +1347,9 @@ static int i915_context_status(struct seq_file *m, void *unused)
seq_putc(m, '\n');
}
- if (dev_priv->ips.renderctx) {
+ if (dev_priv->ips.renderctx.obj) {
seq_puts(m, "render context ");
- describe_obj(m, dev_priv->ips.renderctx);
+ describe_obj(m, dev_priv->ips.renderctx.obj);
seq_putc(m, '\n');
}
@@ -789,7 +789,7 @@ struct intel_ilk_power_mgmt {
int r_t;
struct drm_i915_gem_object *pwrctx;
- struct drm_i915_gem_object *renderctx;
+ struct i915_hw_context renderctx;
};
/* Power well structure for haswell */
@@ -589,7 +589,7 @@ int ironlake_setup_rc6_hw_context(struct drm_i915_private *dev_priv)
intel_ring_emit(ring, MI_SUSPEND_FLUSH | MI_SUSPEND_FLUSH_EN);
intel_ring_emit(ring, MI_SET_CONTEXT);
- intel_ring_emit(ring, i915_gem_obj_ggtt_offset(dev_priv->ips.renderctx) |
+ intel_ring_emit(ring, i915_gem_obj_ggtt_offset(dev_priv->ips.renderctx.obj) |
MI_MM_SPACE_GTT |
MI_SAVE_EXT_STATE_EN |
MI_RESTORE_EXT_STATE_EN |
@@ -3615,10 +3615,10 @@ void ironlake_teardown_rc6(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
- if (dev_priv->ips.renderctx) {
- i915_gem_object_unpin(dev_priv->ips.renderctx);
- drm_gem_object_unreference(&dev_priv->ips.renderctx->base);
- dev_priv->ips.renderctx = NULL;
+ if (dev_priv->ips.renderctx.obj) {
+ i915_gem_object_unpin(dev_priv->ips.renderctx.obj);
+ drm_gem_object_unreference(&dev_priv->ips.renderctx.obj->base);
+ dev_priv->ips.renderctx.obj = NULL;
}
if (dev_priv->ips.pwrctx) {
@@ -3650,9 +3650,12 @@ static int ironlake_setup_rc6(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
- if (dev_priv->ips.renderctx == NULL)
- dev_priv->ips.renderctx = intel_alloc_context_page(dev);
- if (!dev_priv->ips.renderctx)
+ if (dev_priv->ips.renderctx.obj == NULL) {
+ dev_priv->ips.renderctx.id = DEFAULT_CONTEXT_ID;
+ dev_priv->ips.renderctx.ring = &dev_priv->ring[RCS];
+ dev_priv->ips.renderctx.obj = intel_alloc_context_page(dev);
+ }
+ if (dev_priv->ips.renderctx.obj == NULL)
return -ENOMEM;
if (dev_priv->ips.pwrctx == NULL)
The medium term plan is to just use the existing context code on ILK as well. The conversion just assists. Therefore, this is somewhat transient as I plan to kill renderctx quite soon. v2: Make NULL check style consistent (Chris) Ditch superfluous 'else' (Chris) Signed-off-by: Ben Widawsky <ben@bwidawsk.net> --- drivers/gpu/drm/i915/i915_debugfs.c | 4 ++-- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/i915_gem_context.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 17 ++++++++++------- 4 files changed, 14 insertions(+), 11 deletions(-)