outp.c (9793083f1dd9da8dda0ef68e90934dd7d112203b) outp.c (f530bc60a30bee47ff51b7fb71511fdd058b774a)
1/*
2 * Copyright 2021 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the

--- 10 unchanged lines hidden (view full) ---

19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22#include <nvif/outp.h>
23#include <nvif/disp.h>
24#include <nvif/printf.h>
25
26#include <nvif/class.h>
1/*
2 * Copyright 2021 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the

--- 10 unchanged lines hidden (view full) ---

19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22#include <nvif/outp.h>
23#include <nvif/disp.h>
24#include <nvif/printf.h>
25
26#include <nvif/class.h>
27#include <nvif/if0012.h>
28
27
28int
29nvif_outp_infoframe(struct nvif_outp *outp, u8 type, struct nvif_outp_infoframe_v0 *args, u32 size)
30{
31 int ret;
32
33 args->type = type;
34
35 ret = nvif_mthd(&outp->object, NVIF_OUTP_V0_INFOFRAME, args, sizeof(*args) + size);
36 NVIF_ERRON(ret, &outp->object, "[INFOFRAME type:%d size:%d]", type, size);
37 return ret;
38}
39
29void
30nvif_outp_release(struct nvif_outp *outp)
31{
32 int ret = nvif_mthd(&outp->object, NVIF_OUTP_V0_RELEASE, NULL, 0);
33 NVIF_ERRON(ret, &outp->object, "[RELEASE]");
34 outp->or.id = -1;
35}
36

--- 40 unchanged lines hidden (view full) ---

77 ret = nvif_outp_acquire(outp, NVIF_OUTP_ACQUIRE_V0_LVDS, &args);
78 NVIF_ERRON(ret, &outp->object,
79 "[ACQUIRE proto:LVDS dual:%d 8bpc:%d] or:%d link:%d",
80 args.lvds.dual, args.lvds.bpc8, args.or, args.link);
81 return ret;
82}
83
84int
40void
41nvif_outp_release(struct nvif_outp *outp)
42{
43 int ret = nvif_mthd(&outp->object, NVIF_OUTP_V0_RELEASE, NULL, 0);
44 NVIF_ERRON(ret, &outp->object, "[RELEASE]");
45 outp->or.id = -1;
46}
47

--- 40 unchanged lines hidden (view full) ---

88 ret = nvif_outp_acquire(outp, NVIF_OUTP_ACQUIRE_V0_LVDS, &args);
89 NVIF_ERRON(ret, &outp->object,
90 "[ACQUIRE proto:LVDS dual:%d 8bpc:%d] or:%d link:%d",
91 args.lvds.dual, args.lvds.bpc8, args.or, args.link);
92 return ret;
93}
94
95int
85nvif_outp_acquire_tmds(struct nvif_outp *outp, bool hda)
96nvif_outp_acquire_tmds(struct nvif_outp *outp, int head,
97 bool hdmi, u8 max_ac_packet, u8 rekey, u8 scdc, bool hda)
86{
87 struct nvif_outp_acquire_v0 args;
88 int ret;
89
98{
99 struct nvif_outp_acquire_v0 args;
100 int ret;
101
90 args.tmds.hda = hda;
102 args.tmds.head = head;
103 args.tmds.hdmi = hdmi;
104 args.tmds.hdmi_max_ac_packet = max_ac_packet;
105 args.tmds.hdmi_rekey = rekey;
106 args.tmds.hdmi_scdc = scdc;
107 args.tmds.hdmi_hda = hda;
91
92 ret = nvif_outp_acquire(outp, NVIF_OUTP_ACQUIRE_V0_TMDS, &args);
93 NVIF_ERRON(ret, &outp->object,
108
109 ret = nvif_outp_acquire(outp, NVIF_OUTP_ACQUIRE_V0_TMDS, &args);
110 NVIF_ERRON(ret, &outp->object,
94 "[ACQUIRE proto:TMDS hda:%d] or:%d link:%d", args.tmds.hda, args.or, args.link);
111 "[ACQUIRE proto:TMDS head:%d hdmi:%d max_ac_packet:%d rekey:%d scdc:%d hda:%d]"
112 " or:%d link:%d", args.tmds.head, args.tmds.hdmi, args.tmds.hdmi_max_ac_packet,
113 args.tmds.hdmi_rekey, args.tmds.hdmi_scdc, args.tmds.hdmi_hda,
114 args.or, args.link);
95 return ret;
96}
97
98int
99nvif_outp_acquire_rgb_crt(struct nvif_outp *outp)
100{
101 struct nvif_outp_acquire_v0 args;
102 int ret;

--- 44 unchanged lines hidden ---
115 return ret;
116}
117
118int
119nvif_outp_acquire_rgb_crt(struct nvif_outp *outp)
120{
121 struct nvif_outp_acquire_v0 args;
122 int ret;

--- 44 unchanged lines hidden ---