2 * Copyright 2018 Red Hat Inc.
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
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
25 #include <nvif/push507c.h>
28 head827d_curs_clr(struct nv50_head *head)
30 struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
32 if ((push = evo_wait(core, 4))) {
33 evo_mthd(push, 0x0880 + head->base.index * 0x400, 1);
34 evo_data(push, 0x05000000);
35 evo_mthd(push, 0x089c + head->base.index * 0x400, 1);
36 evo_data(push, 0x00000000);
42 head827d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh)
44 struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
46 if ((push = evo_wait(core, 5))) {
47 evo_mthd(push, 0x0880 + head->base.index * 0x400, 2);
48 evo_data(push, 0x80000000 | asyh->curs.layout << 26 |
49 asyh->curs.format << 24);
50 evo_data(push, asyh->curs.offset >> 8);
51 evo_mthd(push, 0x089c + head->base.index * 0x400, 1);
52 evo_data(push, asyh->curs.handle);
58 head827d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh)
60 struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
62 if ((push = evo_wait(core, 9))) {
63 evo_mthd(push, 0x0860 + head->base.index * 0x400, 1);
64 evo_data(push, asyh->core.offset >> 8);
65 evo_mthd(push, 0x0868 + head->base.index * 0x400, 4);
66 evo_data(push, asyh->core.h << 16 | asyh->core.w);
67 evo_data(push, asyh->core.layout << 20 |
68 (asyh->core.pitch >> 8) << 8 |
69 asyh->core.blocks << 8 |
71 evo_data(push, asyh->core.format << 8);
72 evo_data(push, asyh->core.handle);
73 evo_mthd(push, 0x08c0 + head->base.index * 0x400, 1);
74 evo_data(push, asyh->core.y << 16 | asyh->core.x);
80 head827d_olut_clr(struct nv50_head *head)
82 struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
83 const int i = head->base.index;
86 if ((ret = PUSH_WAIT(push, 4)))
89 PUSH_NVSQ(push, NV827D, 0x0840 + (i * 0x400), 0x00000000);
90 PUSH_NVSQ(push, NV827D, 0x085c + (i * 0x400), 0x00000000);
95 head827d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh)
97 struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
98 const int i = head->base.index;
101 if ((ret = PUSH_WAIT(push, 5)))
104 PUSH_NVSQ(push, NV827D, 0x0840 + (i * 0x400), 0x80000000 | asyh->olut.mode << 30,
105 0x0844 + (i * 0x400), asyh->olut.offset >> 8);
106 PUSH_NVSQ(push, NV827D, 0x085c + (i * 0x400), asyh->olut.handle);
110 const struct nv50_head_func
112 .view = head507d_view,
113 .mode = head507d_mode,
114 .olut = head507d_olut,
116 .olut_set = head827d_olut_set,
117 .olut_clr = head827d_olut_clr,
118 .core_calc = head507d_core_calc,
119 .core_set = head827d_core_set,
120 .core_clr = head507d_core_clr,
121 .curs_layout = head507d_curs_layout,
122 .curs_format = head507d_curs_format,
123 .curs_set = head827d_curs_set,
124 .curs_clr = head827d_curs_clr,
125 .base = head507d_base,
126 .ovly = head507d_ovly,
127 .dither = head507d_dither,
128 .procamp = head507d_procamp,