diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-08-10 04:10:27 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-08-10 05:28:09 +1000 |
commit | c02ed2bf98a682c477640c782d1e6a94525b2123 (patch) | |
tree | 119068563210654c7c42742f8a4bcf054c3b179c /drivers/gpu/drm/nouveau/nv50_display.c | |
parent | a3761fa2483f48d158234760d5e25e5071e41537 (diff) | |
download | linux-c02ed2bf98a682c477640c782d1e6a94525b2123.tar.gz linux-c02ed2bf98a682c477640c782d1e6a94525b2123.tar.bz2 linux-c02ed2bf98a682c477640c782d1e6a94525b2123.zip |
drm/nv50-/disp: audit and version SOR_DP_PWR method
The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_display.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_display.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index ac80bdc7cbbf..844fc4ee72bb 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c @@ -1785,9 +1785,18 @@ nv50_sor_dpms(struct drm_encoder *encoder, int mode) .base.hashm = nv_encoder->dcb->hashm, .pwr.state = mode == DRM_MODE_DPMS_ON, }; + struct { + struct nv50_disp_mthd_v1 base; + struct nv50_disp_sor_dp_pwr_v0 pwr; + } link = { + .base.version = 1, + .base.method = NV50_DISP_MTHD_V1_SOR_DP_PWR, + .base.hasht = nv_encoder->dcb->hasht, + .base.hashm = nv_encoder->dcb->hashm, + .pwr.state = mode == DRM_MODE_DPMS_ON, + }; struct drm_device *dev = encoder->dev; struct drm_encoder *partner; - u32 mthd, data; nv_encoder->last_dpms = mode; @@ -1805,16 +1814,10 @@ nv50_sor_dpms(struct drm_encoder *encoder, int mode) } } - mthd = (ffs(nv_encoder->dcb->heads) - 1) << 3; - mthd |= (ffs(nv_encoder->dcb->sorconf.link) - 1) << 2; - mthd |= nv_encoder->or; - if (nv_encoder->dcb->type == DCB_OUTPUT_DP) { args.pwr.state = 1; nvif_mthd(disp->disp, 0, &args, sizeof(args)); - data = (mode == DRM_MODE_DPMS_ON); - mthd |= NV94_DISP_SOR_DP_PWR; - nvif_exec(disp->disp, mthd, &data, sizeof(data)); + nvif_mthd(disp->disp, 0, &link, sizeof(link)); } else { nvif_mthd(disp->disp, 0, &args, sizeof(args)); } |