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:26:57 +1000 |
commit | 84e5a983c2024fc591324962127afda949f195a5 (patch) | |
tree | fb56f22302e95fab04cb353104fc050674e673f7 /nvkm | |
parent | a9d365116dfbddb77067c82bae0a9c842c41163d (diff) | |
download | nouveau-84e5a983c2024fc591324962127afda949f195a5.tar.gz |
disp/nv50-: audit and version LVDS_SCRIPT 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 'nvkm')
-rw-r--r-- | nvkm/engine/disp/nv50.c | 16 | ||||
-rw-r--r-- | nvkm/engine/disp/nv84.c | 1 | ||||
-rw-r--r-- | nvkm/engine/disp/nv94.c | 1 | ||||
-rw-r--r-- | nvkm/engine/disp/nva3.c | 1 | ||||
-rw-r--r-- | nvkm/engine/disp/nvd0.c | 1 | ||||
-rw-r--r-- | nvkm/engine/disp/sornv50.c | 4 | ||||
-rw-r--r-- | nvkm/include/core/class.h | 2 |
7 files changed, 15 insertions, 11 deletions
diff --git a/nvkm/engine/disp/nv50.c b/nvkm/engine/disp/nv50.c index bb5caa7e2..93e06ae67 100644 --- a/nvkm/engine/disp/nv50.c +++ b/nvkm/engine/disp/nv50.c @@ -913,6 +913,21 @@ nv50_disp_base_mthd(struct nouveau_object *object, u32 mthd, if (!priv->sor.hdmi) return -ENODEV; return priv->sor.hdmi(object, priv, data, size, head, outp); + case NV50_DISP_MTHD_V1_SOR_LVDS_SCRIPT: { + union { + struct nv50_disp_sor_lvds_script_v0 v0; + } *args = data; + nv_ioctl(object, "disp sor lvds script size %d\n", size); + if (nvif_unpack(args->v0, 0, 0, false)) { + nv_ioctl(object, "disp sor lvds script " + "vers %d name %04x\n", + args->v0.version, args->v0.script); + priv->sor.lvdsconf = args->v0.script; + return 0; + } else + return ret; + } + break; default: break; } @@ -1041,7 +1056,6 @@ nv50_disp_base_ofuncs = { static struct nouveau_omthds nv50_disp_base_omthds[] = { { HEAD_MTHD(NV50_DISP_SCANOUTPOS) , nv50_disp_base_scanoutpos }, - { SOR_MTHD(NV50_DISP_SOR_LVDS_SCRIPT) , nv50_sor_mthd }, { PIOR_MTHD(NV50_DISP_PIOR_PWR) , nv50_pior_mthd }, { PIOR_MTHD(NV50_DISP_PIOR_TMDS_PWR) , nv50_pior_mthd }, { PIOR_MTHD(NV50_DISP_PIOR_DP_PWR) , nv50_pior_mthd }, diff --git a/nvkm/engine/disp/nv84.c b/nvkm/engine/disp/nv84.c index 49cbecf98..006ccec6b 100644 --- a/nvkm/engine/disp/nv84.c +++ b/nvkm/engine/disp/nv84.c @@ -215,7 +215,6 @@ nv84_disp_sclass[] = { struct nouveau_omthds nv84_disp_base_omthds[] = { { HEAD_MTHD(NV50_DISP_SCANOUTPOS) , nv50_disp_base_scanoutpos }, - { SOR_MTHD(NV50_DISP_SOR_LVDS_SCRIPT) , nv50_sor_mthd }, { PIOR_MTHD(NV50_DISP_PIOR_PWR) , nv50_pior_mthd }, { PIOR_MTHD(NV50_DISP_PIOR_TMDS_PWR) , nv50_pior_mthd }, { PIOR_MTHD(NV50_DISP_PIOR_DP_PWR) , nv50_pior_mthd }, diff --git a/nvkm/engine/disp/nv94.c b/nvkm/engine/disp/nv94.c index 7234237f4..f926e967f 100644 --- a/nvkm/engine/disp/nv94.c +++ b/nvkm/engine/disp/nv94.c @@ -74,7 +74,6 @@ nv94_disp_sclass[] = { static struct nouveau_omthds nv94_disp_base_omthds[] = { { HEAD_MTHD(NV50_DISP_SCANOUTPOS) , nv50_disp_base_scanoutpos }, - { SOR_MTHD(NV50_DISP_SOR_LVDS_SCRIPT) , nv50_sor_mthd }, { SOR_MTHD(NV94_DISP_SOR_DP_PWR) , nv50_sor_mthd }, { PIOR_MTHD(NV50_DISP_PIOR_PWR) , nv50_pior_mthd }, { PIOR_MTHD(NV50_DISP_PIOR_TMDS_PWR) , nv50_pior_mthd }, diff --git a/nvkm/engine/disp/nva3.c b/nvkm/engine/disp/nva3.c index 488623386..e87ee1eee 100644 --- a/nvkm/engine/disp/nva3.c +++ b/nvkm/engine/disp/nva3.c @@ -46,7 +46,6 @@ nva3_disp_sclass[] = { static struct nouveau_omthds nva3_disp_base_omthds[] = { { HEAD_MTHD(NV50_DISP_SCANOUTPOS) , nv50_disp_base_scanoutpos }, - { SOR_MTHD(NV50_DISP_SOR_LVDS_SCRIPT) , nv50_sor_mthd }, { SOR_MTHD(NV94_DISP_SOR_DP_PWR) , nv50_sor_mthd }, { PIOR_MTHD(NV50_DISP_PIOR_PWR) , nv50_pior_mthd }, { PIOR_MTHD(NV50_DISP_PIOR_TMDS_PWR) , nv50_pior_mthd }, diff --git a/nvkm/engine/disp/nvd0.c b/nvkm/engine/disp/nvd0.c index 7f035f33f..bceb7bd2c 100644 --- a/nvkm/engine/disp/nvd0.c +++ b/nvkm/engine/disp/nvd0.c @@ -712,7 +712,6 @@ nvd0_disp_base_ofuncs = { struct nouveau_omthds nvd0_disp_base_omthds[] = { { HEAD_MTHD(NV50_DISP_SCANOUTPOS) , nvd0_disp_base_scanoutpos }, - { SOR_MTHD(NV50_DISP_SOR_LVDS_SCRIPT) , nv50_sor_mthd }, { SOR_MTHD(NV94_DISP_SOR_DP_PWR) , nv50_sor_mthd }, { PIOR_MTHD(NV50_DISP_PIOR_PWR) , nv50_pior_mthd }, { PIOR_MTHD(NV50_DISP_PIOR_TMDS_PWR) , nv50_pior_mthd }, diff --git a/nvkm/engine/disp/sornv50.c b/nvkm/engine/disp/sornv50.c index 5f2d71c3f..25344feb9 100644 --- a/nvkm/engine/disp/sornv50.c +++ b/nvkm/engine/disp/sornv50.c @@ -84,10 +84,6 @@ nv50_sor_mthd(struct nouveau_object *object, u32 mthd, void *args, u32 size) } switch (mthd & ~0x3f) { - case NV50_DISP_SOR_LVDS_SCRIPT: - priv->sor.lvdsconf = data & NV50_DISP_SOR_LVDS_SCRIPT_ID; - ret = 0; - break; case NV94_DISP_SOR_DP_PWR: if (outp) { struct nvkm_output_dp *outpdp = (void *)outp; diff --git a/nvkm/include/core/class.h b/nvkm/include/core/class.h index e54d9cc54..d63edc73a 100644 --- a/nvkm/include/core/class.h +++ b/nvkm/include/core/class.h @@ -59,8 +59,6 @@ struct nv04_display_scanoutpos { #define NV50_DISP_SOR_MTHD_LINK 0x00000004 #define NV50_DISP_SOR_MTHD_OR 0x00000003 -#define NV50_DISP_SOR_LVDS_SCRIPT 0x00013000 -#define NV50_DISP_SOR_LVDS_SCRIPT_ID 0x0000ffff #define NV94_DISP_SOR_DP_PWR 0x00016000 #define NV94_DISP_SOR_DP_PWR_STATE 0x00000001 #define NV94_DISP_SOR_DP_PWR_STATE_OFF 0x00000000 |