- transition from "ioctl" interface

Signed-off-by: Ben Skeggs <bske...@nvidia.com>
---
 drivers/gpu/drm/nouveau/include/nvif/driverif.h  |  1 +
 drivers/gpu/drm/nouveau/include/nvif/if0012.h    |  7 -------
 drivers/gpu/drm/nouveau/nvif/outp.c              |  2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c | 15 ++++++++-------
 4 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/include/nvif/driverif.h 
b/drivers/gpu/drm/nouveau/include/nvif/driverif.h
index a2e0423f76c2..2b29ac64e5cd 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/driverif.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/driverif.h
@@ -279,6 +279,7 @@ struct nvif_outp_impl {
        int (*inherit)(struct nvif_outp_priv *, enum nvif_outp_proto,
                       u8 *or, u8 *link, u8 *head, u8 *proto_evo);
        int (*acquire)(struct nvif_outp_priv *, enum nvif_outp_type, bool hda, 
u8 *or, u8 *link);
+       int (*release)(struct nvif_outp_priv *);
 
        int (*load_detect)(struct nvif_outp_priv *, u32 loadval, u8 *load);
 
diff --git a/drivers/gpu/drm/nouveau/include/nvif/if0012.h 
b/drivers/gpu/drm/nouveau/include/nvif/if0012.h
index 3cbdb5fc4757..1a8f0720c14a 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/if0012.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/if0012.h
@@ -4,8 +4,6 @@
 
 #include <drm/display/drm_dp.h>
 
-#define NVIF_OUTP_V0_RELEASE       0x12
-
 #define NVIF_OUTP_V0_BL_GET        0x30
 #define NVIF_OUTP_V0_BL_SET        0x31
 
@@ -26,11 +24,6 @@
 #define NVIF_OUTP_V0_DP_MST_ID_PUT 0x77
 #define NVIF_OUTP_V0_DP_MST_VCPI   0x78
 
-union nvif_outp_release_args {
-       struct nvif_outp_release_vn {
-       } vn;
-};
-
 union nvif_outp_bl_get_args {
        struct nvif_outp_bl_get_v0 {
                __u8  version;
diff --git a/drivers/gpu/drm/nouveau/nvif/outp.c 
b/drivers/gpu/drm/nouveau/nvif/outp.c
index ddcd2b9d69f3..efdcc1c28874 100644
--- a/drivers/gpu/drm/nouveau/nvif/outp.c
+++ b/drivers/gpu/drm/nouveau/nvif/outp.c
@@ -296,7 +296,7 @@ nvif_outp_bl_get(struct nvif_outp *outp)
 void
 nvif_outp_release(struct nvif_outp *outp)
 {
-       int ret = nvif_mthd(&outp->object, NVIF_OUTP_V0_RELEASE, NULL, 0);
+       int ret = outp->impl->release(outp->priv);
        NVIF_ERRON(ret, &outp->object, "[RELEASE]");
        outp->or.id = -1;
 }
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c
index 46ca915f0206..f5d3b3647dac 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c
@@ -359,16 +359,17 @@ nvkm_uoutp_mthd_bl_get(struct nvkm_outp *outp, void 
*argv, u32 argc)
 }
 
 static int
-nvkm_uoutp_mthd_release(struct nvkm_outp *outp, void *argv, u32 argc)
+nvkm_uoutp_release(struct nvif_outp_priv *uoutp)
 {
-       union nvif_outp_release_args *args = argv;
+       struct nvkm_outp *outp = uoutp->outp;
+       int ret;
 
-       if (argc != sizeof(args->vn))
-               return -ENOSYS;
-       if (!outp->ior)
-               return -EINVAL;
+       ret = nvkm_uoutp_lock_acquired(uoutp);
+       if (ret)
+               return ret;
 
        outp->func->release(outp);
+       nvkm_uoutp_unlock(uoutp);
        return 0;
 }
 
@@ -530,7 +531,6 @@ static int
 nvkm_uoutp_mthd_acquired(struct nvkm_outp *outp, u32 mthd, void *argv, u32 
argc)
 {
        switch (mthd) {
-       case NVIF_OUTP_V0_RELEASE      : return nvkm_uoutp_mthd_release      
(outp, argv, argc);
        case NVIF_OUTP_V0_LVDS         : return nvkm_uoutp_mthd_lvds         
(outp, argv, argc);
        case NVIF_OUTP_V0_HDMI         : return nvkm_uoutp_mthd_hdmi         
(outp, argv, argc);
        case NVIF_OUTP_V0_INFOFRAME    : return nvkm_uoutp_mthd_infoframe    
(outp, argv, argc);
@@ -602,6 +602,7 @@ nvkm_uoutp_impl = {
        .del = nvkm_uoutp_del,
        .inherit = nvkm_uoutp_inherit,
        .acquire = nvkm_uoutp_acquire,
+       .release = nvkm_uoutp_release,
 };
 
 static void *
-- 
2.41.0

Reply via email to