mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
drm/nouveau/disp: add acquire_dac()
- preparing to move protocol-specific args out of acquire() again - avoid re-acquiring acquired output, will matter when enforced later - this one is basically just a rename Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Acked-by: Danilo Krummrich <me@dakr.org> Signed-off-by: Lyude Paul <lyude@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-13-lyude@redhat.com
This commit is contained in:
parent
68ee172269
commit
724e0f3b8b
|
|
@ -502,7 +502,8 @@ nv50_dac_atomic_enable(struct drm_encoder *encoder, struct drm_atomic_state *sta
|
|||
|
||||
ctrl |= NVDEF(NV507D, DAC_SET_CONTROL, PROTOCOL, RGB_CRT);
|
||||
|
||||
nvif_outp_acquire_rgb_crt(&nv_encoder->outp);
|
||||
if (!nvif_outp_acquired(&nv_encoder->outp))
|
||||
nvif_outp_acquire_dac(&nv_encoder->outp);
|
||||
|
||||
core->func->dac->ctrl(core, nv_encoder->outp.or.id, ctrl, asyh);
|
||||
asyh->or.depth = 0;
|
||||
|
|
|
|||
|
|
@ -59,12 +59,11 @@ union nvif_outp_load_detect_args {
|
|||
union nvif_outp_acquire_args {
|
||||
struct nvif_outp_acquire_v0 {
|
||||
__u8 version;
|
||||
#define NVIF_OUTP_ACQUIRE_V0_RGB_CRT 0x00
|
||||
#define NVIF_OUTP_ACQUIRE_V0_TV 0x01
|
||||
#define NVIF_OUTP_ACQUIRE_V0_DAC 0x00
|
||||
#define NVIF_OUTP_ACQUIRE_V0_TMDS 0x02
|
||||
#define NVIF_OUTP_ACQUIRE_V0_LVDS 0x03
|
||||
#define NVIF_OUTP_ACQUIRE_V0_DP 0x04
|
||||
__u8 proto;
|
||||
__u8 type;
|
||||
__u8 or;
|
||||
__u8 link;
|
||||
__u8 pad04[4];
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ enum nvif_outp_detect_status nvif_outp_detect(struct nvif_outp *);
|
|||
int nvif_outp_edid_get(struct nvif_outp *, u8 **pedid);
|
||||
|
||||
int nvif_outp_load_detect(struct nvif_outp *, u32 loadval);
|
||||
int nvif_outp_acquire_rgb_crt(struct nvif_outp *);
|
||||
int nvif_outp_acquire_dac(struct nvif_outp *);
|
||||
int nvif_outp_acquire_tmds(struct nvif_outp *, int head,
|
||||
bool hdmi, u8 max_ac_packet, u8 rekey, u8 scdc, bool hda);
|
||||
int nvif_outp_acquire_lvds(struct nvif_outp *, bool dual, bool bpc8);
|
||||
|
|
@ -40,6 +40,13 @@ int nvif_outp_inherit_tmds(struct nvif_outp *outp, u8 *proto_out);
|
|||
int nvif_outp_inherit_dp(struct nvif_outp *outp, u8 *proto_out);
|
||||
|
||||
void nvif_outp_release(struct nvif_outp *);
|
||||
|
||||
static inline bool
|
||||
nvif_outp_acquired(struct nvif_outp *outp)
|
||||
{
|
||||
return outp->or.id >= 0;
|
||||
}
|
||||
|
||||
int nvif_outp_infoframe(struct nvif_outp *, u8 type, struct nvif_outp_infoframe_v0 *, u32 size);
|
||||
int nvif_outp_hda_eld(struct nvif_outp *, int head, void *data, u32 size);
|
||||
int nvif_outp_dp_aux_pwr(struct nvif_outp *, bool enable);
|
||||
|
|
|
|||
|
|
@ -171,12 +171,12 @@ nvif_outp_release(struct nvif_outp *outp)
|
|||
}
|
||||
|
||||
static inline int
|
||||
nvif_outp_acquire(struct nvif_outp *outp, u8 proto, struct nvif_outp_acquire_v0 *args)
|
||||
nvif_outp_acquire(struct nvif_outp *outp, u8 type, struct nvif_outp_acquire_v0 *args)
|
||||
{
|
||||
int ret;
|
||||
|
||||
args->version = 0;
|
||||
args->proto = proto;
|
||||
args->type = type;
|
||||
|
||||
ret = nvif_mthd(&outp->object, NVIF_OUTP_V0_ACQUIRE, args, sizeof(*args));
|
||||
if (ret)
|
||||
|
|
@ -188,13 +188,13 @@ nvif_outp_acquire(struct nvif_outp *outp, u8 proto, struct nvif_outp_acquire_v0
|
|||
}
|
||||
|
||||
int
|
||||
nvif_outp_acquire_rgb_crt(struct nvif_outp *outp)
|
||||
nvif_outp_acquire_dac(struct nvif_outp *outp)
|
||||
{
|
||||
struct nvif_outp_acquire_v0 args;
|
||||
int ret;
|
||||
|
||||
ret = nvif_outp_acquire(outp, NVIF_OUTP_ACQUIRE_V0_RGB_CRT, &args);
|
||||
NVIF_ERRON(ret, &outp->object, "[ACQUIRE proto:RGB_CRT] or:%d", args.or);
|
||||
ret = nvif_outp_acquire(outp, NVIF_OUTP_ACQUIRE_V0_DAC, &args);
|
||||
NVIF_ERRON(ret, &outp->object, "[ACQUIRE DAC] or:%d", args.or);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -217,8 +217,8 @@ nvkm_uoutp_mthd_acquire(struct nvkm_outp *outp, void *argv, u32 argc)
|
|||
if (outp->ior)
|
||||
return -EBUSY;
|
||||
|
||||
switch (args->v0.proto) {
|
||||
case NVIF_OUTP_ACQUIRE_V0_RGB_CRT:
|
||||
switch (args->v0.type) {
|
||||
case NVIF_OUTP_ACQUIRE_V0_DAC:
|
||||
ret = nvkm_outp_acquire_or(outp, NVKM_OUTP_USER, false);
|
||||
break;
|
||||
case NVIF_OUTP_ACQUIRE_V0_TMDS:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user