Skip to content

Commit 1f767e0

Browse files
ickledanvet
authored andcommitted
drm/i915: HWS must be in the mappable region for g33
On g33, the documentation states "HWS_PGA: Format = Bits 28:12 of graphics memory address (bits 31:29 MBZ)." which translates to that the address of the HWS must be below 256MiB, which is conveniently the mappable aperture. This also appears to be true (but not documented as so) for gen4 and gen5. To generalise we force it into the low mappable region for all non-LLC platforms. If we locate the HWS at the top of the GTT the machine will hard hang during boot (fails on pnv, gm45, ilk and byt, but works on snb, ivb, hsw). v2: Add comments to explain why use PIN_MAPPABLE even though we have no intention of mapping the object. (Ville) Signed-off-by: Chris Wilson <[email protected]> Cc: Ville Syrjälä <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
1 parent 31685c2 commit 1f767e0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

drivers/gpu/drm/i915/intel_ringbuffer.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,7 @@ static int init_status_page(struct intel_engine_cs *ring)
14321432
struct drm_i915_gem_object *obj;
14331433

14341434
if ((obj = ring->status_page.obj) == NULL) {
1435+
unsigned flags;
14351436
int ret;
14361437

14371438
obj = i915_gem_alloc_object(ring->dev, 4096);
@@ -1444,7 +1445,20 @@ static int init_status_page(struct intel_engine_cs *ring)
14441445
if (ret)
14451446
goto err_unref;
14461447

1447-
ret = i915_gem_obj_ggtt_pin(obj, 4096, 0);
1448+
flags = 0;
1449+
if (!HAS_LLC(ring->dev))
1450+
/* On g33, we cannot place HWS above 256MiB, so
1451+
* restrict its pinning to the low mappable arena.
1452+
* Though this restriction is not documented for
1453+
* gen4, gen5, or byt, they also behave similarly
1454+
* and hang if the HWS is placed at the top of the
1455+
* GTT. To generalise, it appears that all !llc
1456+
* platforms have issues with us placing the HWS
1457+
* above the mappable region (even though we never
1458+
* actualy map it).
1459+
*/
1460+
flags |= PIN_MAPPABLE;
1461+
ret = i915_gem_obj_ggtt_pin(obj, 4096, flags);
14481462
if (ret) {
14491463
err_unref:
14501464
drm_gem_object_unreference(&obj->base);

0 commit comments

Comments
 (0)