diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2017-06-17 04:19:22 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2017-06-17 04:23:44 +0300 |
commit | 7df1bb87b8cb0b618e4b5964f89d81d8ce52c58e (patch) | |
tree | cc3cad38c64b3e565e5d8439a9e3f029d3fa0dbd /drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c | |
parent | 5499473c86503bb8e307ff7b554643a99a9478c2 (diff) | |
download | linux-7df1bb87b8cb0b618e4b5964f89d81d8ce52c58e.tar.xz |
drm/nouveau/disp/nv50-: avoid creating ORs that aren't present on HW
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c | 11 |
1 files changed, 10 insertions, 1 deletions
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); } |