Skip to content

Commit 3486977

Browse files
zhenywtursulin
authored andcommitted
drm/i915: check ppgtt validity when init reg state
Check if ppgtt is valid for context when init reg state. For gvt context which has no i915 allocated ppgtt, failed to check that would cause kernel null ptr reference error. v2: remove !48bit ppgtt case as we'll always update before submit (Chris) Signed-off-by: Zhenyu Wang <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Tvrtko Ursulin <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 16ee206 commit 3486977

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/gpu/drm/i915/intel_lrc.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,19 +2103,12 @@ static void execlists_init_reg_state(u32 *reg_state,
21032103
ASSIGN_CTX_REG(reg_state, CTX_PDP0_LDW, GEN8_RING_PDP_LDW(engine, 0),
21042104
0);
21052105

2106-
if (USES_FULL_48BIT_PPGTT(ppgtt->base.dev)) {
2106+
if (ppgtt && USES_FULL_48BIT_PPGTT(ppgtt->base.dev)) {
21072107
/* 64b PPGTT (48bit canonical)
21082108
* PDP0_DESCRIPTOR contains the base address to PML4 and
21092109
* other PDP Descriptors are ignored.
21102110
*/
21112111
ASSIGN_CTX_PML4(ppgtt, reg_state);
2112-
} else {
2113-
/* 32b PPGTT
2114-
* PDP*_DESCRIPTOR contains the base address of space supported.
2115-
* With dynamic page allocation, PDPs may not be allocated at
2116-
* this point. Point the unallocated PDPs to the scratch page
2117-
*/
2118-
execlists_update_context_pdps(ppgtt, reg_state);
21192112
}
21202113

21212114
if (engine->id == RCS) {

0 commit comments

Comments
 (0)