|
@@ -1899,6 +1899,17 @@ i915_dispatch_execbuffer(struct drm_i915_gem_request *req,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+static void cleanup_phys_status_page(struct intel_engine_cs *ring)
|
|
|
+{
|
|
|
+ struct drm_i915_private *dev_priv = to_i915(ring->dev);
|
|
|
+
|
|
|
+ if (!dev_priv->status_page_dmah)
|
|
|
+ return;
|
|
|
+
|
|
|
+ drm_pci_free(ring->dev, dev_priv->status_page_dmah);
|
|
|
+ ring->status_page.page_addr = NULL;
|
|
|
+}
|
|
|
+
|
|
|
static void cleanup_status_page(struct intel_engine_cs *ring)
|
|
|
{
|
|
|
struct drm_i915_gem_object *obj;
|
|
@@ -1915,9 +1926,9 @@ static void cleanup_status_page(struct intel_engine_cs *ring)
|
|
|
|
|
|
static int init_status_page(struct intel_engine_cs *ring)
|
|
|
{
|
|
|
- struct drm_i915_gem_object *obj;
|
|
|
+ struct drm_i915_gem_object *obj = ring->status_page.obj;
|
|
|
|
|
|
- if ((obj = ring->status_page.obj) == NULL) {
|
|
|
+ if (obj == NULL) {
|
|
|
unsigned flags;
|
|
|
int ret;
|
|
|
|
|
@@ -2162,7 +2173,7 @@ static int intel_init_ring_buffer(struct drm_device *dev,
|
|
|
if (ret)
|
|
|
goto error;
|
|
|
} else {
|
|
|
- BUG_ON(ring->id != RCS);
|
|
|
+ WARN_ON(ring->id != RCS);
|
|
|
ret = init_phys_status_page(ring);
|
|
|
if (ret)
|
|
|
goto error;
|
|
@@ -2208,7 +2219,12 @@ void intel_cleanup_ring_buffer(struct intel_engine_cs *ring)
|
|
|
if (ring->cleanup)
|
|
|
ring->cleanup(ring);
|
|
|
|
|
|
- cleanup_status_page(ring);
|
|
|
+ if (I915_NEED_GFX_HWS(ring->dev)) {
|
|
|
+ cleanup_status_page(ring);
|
|
|
+ } else {
|
|
|
+ WARN_ON(ring->id != RCS);
|
|
|
+ cleanup_phys_status_page(ring);
|
|
|
+ }
|
|
|
|
|
|
i915_cmd_parser_fini_ring(ring);
|
|
|
i915_gem_batch_pool_fini(&ring->batch_pool);
|