Commit 8a7783c7 authored by Ben Skeggs's avatar Ben Skeggs Committed by Lyude Paul

drm/nouveau/disp: rename internal output acquire/release functions

These will be made static later in the patch series, after the code that
uses them has been cleaned up in preparation for GSP-RM support.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
Acked-by: default avatarDanilo Krummrich <me@dakr.org>
Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-10-lyude@redhat.com
parent 0cd7e071
...@@ -89,7 +89,7 @@ nvkm_outp_xlat(struct nvkm_outp *outp, enum nvkm_ior_type *type) ...@@ -89,7 +89,7 @@ nvkm_outp_xlat(struct nvkm_outp *outp, enum nvkm_ior_type *type)
} }
void void
nvkm_outp_release(struct nvkm_outp *outp, u8 user) nvkm_outp_release_or(struct nvkm_outp *outp, u8 user)
{ {
struct nvkm_ior *ior = outp->ior; struct nvkm_ior *ior = outp->ior;
OUTP_TRACE(outp, "release %02x &= %02x %p", outp->acquired, ~user, ior); OUTP_TRACE(outp, "release %02x &= %02x %p", outp->acquired, ~user, ior);
...@@ -142,7 +142,7 @@ nvkm_outp_acquire_hda(struct nvkm_outp *outp, enum nvkm_ior_type type, ...@@ -142,7 +142,7 @@ nvkm_outp_acquire_hda(struct nvkm_outp *outp, enum nvkm_ior_type type,
} }
int int
nvkm_outp_acquire(struct nvkm_outp *outp, u8 user, bool hda) nvkm_outp_acquire_or(struct nvkm_outp *outp, u8 user, bool hda)
{ {
struct nvkm_ior *ior = outp->ior; struct nvkm_ior *ior = outp->ior;
enum nvkm_ior_proto proto; enum nvkm_ior_proto proto;
...@@ -234,6 +234,12 @@ nvkm_outp_detect(struct nvkm_outp *outp) ...@@ -234,6 +234,12 @@ nvkm_outp_detect(struct nvkm_outp *outp)
return ret; return ret;
} }
void
nvkm_outp_release(struct nvkm_outp *outp)
{
nvkm_outp_release_or(outp, NVKM_OUTP_USER);
}
void void
nvkm_outp_fini(struct nvkm_outp *outp) nvkm_outp_fini(struct nvkm_outp *outp)
{ {
......
...@@ -77,8 +77,9 @@ void nvkm_outp_fini(struct nvkm_outp *); ...@@ -77,8 +77,9 @@ void nvkm_outp_fini(struct nvkm_outp *);
int nvkm_outp_detect(struct nvkm_outp *); int nvkm_outp_detect(struct nvkm_outp *);
int nvkm_outp_acquire(struct nvkm_outp *, u8 user, bool hda); int nvkm_outp_acquire_or(struct nvkm_outp *, u8 user, bool hda);
void nvkm_outp_release(struct nvkm_outp *, u8 user); void nvkm_outp_release(struct nvkm_outp *);
void nvkm_outp_release_or(struct nvkm_outp *, u8 user);
void nvkm_outp_route(struct nvkm_disp *); void nvkm_outp_route(struct nvkm_disp *);
struct nvkm_outp_func { struct nvkm_outp_func {
......
...@@ -141,7 +141,7 @@ nvkm_uoutp_mthd_release(struct nvkm_outp *outp, void *argv, u32 argc) ...@@ -141,7 +141,7 @@ nvkm_uoutp_mthd_release(struct nvkm_outp *outp, void *argv, u32 argc)
ior->func->hdmi->ctrl(ior, head->id, false, 0, 0); ior->func->hdmi->ctrl(ior, head->id, false, 0, 0);
} }
nvkm_outp_release(outp, NVKM_OUTP_USER); nvkm_outp_release(outp);
return 0; return 0;
} }
...@@ -151,7 +151,7 @@ nvkm_uoutp_mthd_acquire_dp(struct nvkm_outp *outp, u8 dpcd[DP_RECEIVER_CAP_SIZE] ...@@ -151,7 +151,7 @@ nvkm_uoutp_mthd_acquire_dp(struct nvkm_outp *outp, u8 dpcd[DP_RECEIVER_CAP_SIZE]
{ {
int ret; int ret;
ret = nvkm_outp_acquire(outp, NVKM_OUTP_USER, hda); ret = nvkm_outp_acquire_or(outp, NVKM_OUTP_USER, hda);
if (ret) if (ret)
return ret; return ret;
...@@ -172,7 +172,7 @@ nvkm_uoutp_mthd_acquire_tmds(struct nvkm_outp *outp, u8 head, u8 hdmi, u8 hdmi_m ...@@ -172,7 +172,7 @@ nvkm_uoutp_mthd_acquire_tmds(struct nvkm_outp *outp, u8 head, u8 hdmi, u8 hdmi_m
if (!(outp->asy.head = nvkm_head_find(outp->disp, head))) if (!(outp->asy.head = nvkm_head_find(outp->disp, head)))
return -EINVAL; return -EINVAL;
ret = nvkm_outp_acquire(outp, NVKM_OUTP_USER, hdmi && hdmi_hda); ret = nvkm_outp_acquire_or(outp, NVKM_OUTP_USER, hdmi && hdmi_hda);
if (ret) if (ret)
return ret; return ret;
...@@ -182,7 +182,7 @@ nvkm_uoutp_mthd_acquire_tmds(struct nvkm_outp *outp, u8 head, u8 hdmi, u8 hdmi_m ...@@ -182,7 +182,7 @@ nvkm_uoutp_mthd_acquire_tmds(struct nvkm_outp *outp, u8 head, u8 hdmi, u8 hdmi_m
if (!ior->func->hdmi || if (!ior->func->hdmi ||
hdmi_max_ac_packet > 0x1f || hdmi_rekey > 0x7f || hdmi_max_ac_packet > 0x1f || hdmi_rekey > 0x7f ||
(hdmi_scdc && !ior->func->hdmi->scdc)) { (hdmi_scdc && !ior->func->hdmi->scdc)) {
nvkm_outp_release(outp, NVKM_OUTP_USER); nvkm_outp_release_or(outp, NVKM_OUTP_USER);
return -EINVAL; return -EINVAL;
} }
...@@ -203,7 +203,7 @@ nvkm_uoutp_mthd_acquire_lvds(struct nvkm_outp *outp, bool dual, bool bpc8) ...@@ -203,7 +203,7 @@ nvkm_uoutp_mthd_acquire_lvds(struct nvkm_outp *outp, bool dual, bool bpc8)
outp->lvds.dual = dual; outp->lvds.dual = dual;
outp->lvds.bpc8 = bpc8; outp->lvds.bpc8 = bpc8;
return nvkm_outp_acquire(outp, NVKM_OUTP_USER, false); return nvkm_outp_acquire_or(outp, NVKM_OUTP_USER, false);
} }
static int static int
...@@ -219,7 +219,7 @@ nvkm_uoutp_mthd_acquire(struct nvkm_outp *outp, void *argv, u32 argc) ...@@ -219,7 +219,7 @@ nvkm_uoutp_mthd_acquire(struct nvkm_outp *outp, void *argv, u32 argc)
switch (args->v0.proto) { switch (args->v0.proto) {
case NVIF_OUTP_ACQUIRE_V0_RGB_CRT: case NVIF_OUTP_ACQUIRE_V0_RGB_CRT:
ret = nvkm_outp_acquire(outp, NVKM_OUTP_USER, false); ret = nvkm_outp_acquire_or(outp, NVKM_OUTP_USER, false);
break; break;
case NVIF_OUTP_ACQUIRE_V0_TMDS: case NVIF_OUTP_ACQUIRE_V0_TMDS:
ret = nvkm_uoutp_mthd_acquire_tmds(outp, args->v0.tmds.head, ret = nvkm_uoutp_mthd_acquire_tmds(outp, args->v0.tmds.head,
...@@ -261,7 +261,7 @@ nvkm_uoutp_mthd_load_detect(struct nvkm_outp *outp, void *argv, u32 argc) ...@@ -261,7 +261,7 @@ nvkm_uoutp_mthd_load_detect(struct nvkm_outp *outp, void *argv, u32 argc)
if (argc != sizeof(args->v0) || args->v0.version != 0) if (argc != sizeof(args->v0) || args->v0.version != 0)
return -ENOSYS; return -ENOSYS;
ret = nvkm_outp_acquire(outp, NVKM_OUTP_PRIV, false); ret = nvkm_outp_acquire_or(outp, NVKM_OUTP_PRIV, false);
if (ret == 0) { if (ret == 0) {
if (outp->ior->func->sense) { if (outp->ior->func->sense) {
ret = outp->ior->func->sense(outp->ior, args->v0.data); ret = outp->ior->func->sense(outp->ior, args->v0.data);
...@@ -269,7 +269,7 @@ nvkm_uoutp_mthd_load_detect(struct nvkm_outp *outp, void *argv, u32 argc) ...@@ -269,7 +269,7 @@ nvkm_uoutp_mthd_load_detect(struct nvkm_outp *outp, void *argv, u32 argc)
} else { } else {
ret = -EINVAL; ret = -EINVAL;
} }
nvkm_outp_release(outp, NVKM_OUTP_PRIV); nvkm_outp_release_or(outp, NVKM_OUTP_PRIV);
} }
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment