From 7df1bb87b8cb0b618e4b5964f89d81d8ce52c58e Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sat, 17 Jun 2017 11:19:22 +1000 Subject: drm/nouveau/disp/nv50-: avoid creating ORs that aren't present on HW Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c') diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c index dbb303db3178..f3ebd0c22e7d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c @@ -84,6 +84,15 @@ nv50_sor_state(struct nvkm_ior *sor, struct nvkm_ior_state *state) state->head = ctrl & 0x00000003; } +int +nv50_sor_new_(const struct nvkm_ior_func *func, struct nvkm_disp *disp, int id) +{ + struct nvkm_device *device = disp->engine.subdev.device; + if (!(nvkm_rd32(device, 0x610184) & (0x01000000 << id))) + return 0; + return nvkm_ior_new_(func, disp, SOR, id); +} + static const struct nvkm_ior_func nv50_sor = { .state = nv50_sor_state, @@ -94,5 +103,5 @@ nv50_sor = { int nv50_sor_new(struct nvkm_disp *disp, int id) { - return nvkm_ior_new_(&nv50_sor, disp, SOR, id); + return nv50_sor_new_(&nv50_sor, disp, id); } -- cgit v1.2.3