@@ -1922,6 +1922,17 @@ i915_dispatch_execbuffer(struct drm_i915_gem_request *req,
1922
1922
return 0 ;
1923
1923
}
1924
1924
1925
+ static void cleanup_phys_status_page (struct intel_engine_cs * ring )
1926
+ {
1927
+ struct drm_i915_private * dev_priv = to_i915 (ring -> dev );
1928
+
1929
+ if (!dev_priv -> status_page_dmah )
1930
+ return ;
1931
+
1932
+ drm_pci_free (ring -> dev , dev_priv -> status_page_dmah );
1933
+ ring -> status_page .page_addr = NULL ;
1934
+ }
1935
+
1925
1936
static void cleanup_status_page (struct intel_engine_cs * ring )
1926
1937
{
1927
1938
struct drm_i915_gem_object * obj ;
@@ -1938,9 +1949,9 @@ static void cleanup_status_page(struct intel_engine_cs *ring)
1938
1949
1939
1950
static int init_status_page (struct intel_engine_cs * ring )
1940
1951
{
1941
- struct drm_i915_gem_object * obj ;
1952
+ struct drm_i915_gem_object * obj = ring -> status_page . obj ;
1942
1953
1943
- if (( obj = ring -> status_page . obj ) == NULL ) {
1954
+ if (obj == NULL ) {
1944
1955
unsigned flags ;
1945
1956
int ret ;
1946
1957
@@ -2134,7 +2145,7 @@ static int intel_init_ring_buffer(struct drm_device *dev,
2134
2145
if (ret )
2135
2146
goto error ;
2136
2147
} else {
2137
- BUG_ON (ring -> id != RCS );
2148
+ WARN_ON (ring -> id != RCS );
2138
2149
ret = init_phys_status_page (ring );
2139
2150
if (ret )
2140
2151
goto error ;
@@ -2179,7 +2190,12 @@ void intel_cleanup_ring_buffer(struct intel_engine_cs *ring)
2179
2190
if (ring -> cleanup )
2180
2191
ring -> cleanup (ring );
2181
2192
2182
- cleanup_status_page (ring );
2193
+ if (I915_NEED_GFX_HWS (ring -> dev )) {
2194
+ cleanup_status_page (ring );
2195
+ } else {
2196
+ WARN_ON (ring -> id != RCS );
2197
+ cleanup_phys_status_page (ring );
2198
+ }
2183
2199
2184
2200
i915_cmd_parser_fini_ring (ring );
2185
2201
i915_gem_batch_pool_fini (& ring -> batch_pool );
0 commit comments