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 head917d_dither(struct nv50_head *head, struct nv50_head_atom *asyh)
30 struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
31 const int i = head->base.index;
34 if ((ret = PUSH_WAIT(push, 2)))
37 PUSH_NVSQ(push, NV917D, 0x04a0 + (i * 0x300), asyh->dither.mode << 3 |
38 asyh->dither.bits << 1 |
44 head917d_base(struct nv50_head *head, struct nv50_head_atom *asyh)
46 struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
47 const int i = head->base.index;
52 switch (asyh->base.cpp) {
53 case 8: bounds |= 0x00000500; break;
54 case 4: bounds |= 0x00000300; break;
55 case 2: bounds |= 0x00000100; break;
56 case 1: bounds |= 0x00000000; break;
64 if ((ret = PUSH_WAIT(push, 2)))
67 PUSH_NVSQ(push, NV917D, 0x04d0 + (i * 0x300), bounds);
72 head917d_curs_layout(struct nv50_head *head, struct nv50_wndw_atom *asyw,
73 struct nv50_head_atom *asyh)
75 switch (asyw->state.fb->width) {
76 case 32: asyh->curs.layout = 0; break;
77 case 64: asyh->curs.layout = 1; break;
78 case 128: asyh->curs.layout = 2; break;
79 case 256: asyh->curs.layout = 3; break;
86 const struct nv50_head_func
88 .view = head907d_view,
89 .mode = head907d_mode,
90 .olut = head907d_olut,
92 .olut_set = head907d_olut_set,
93 .olut_clr = head907d_olut_clr,
94 .core_calc = head507d_core_calc,
95 .core_set = head907d_core_set,
96 .core_clr = head907d_core_clr,
97 .curs_layout = head917d_curs_layout,
98 .curs_format = head507d_curs_format,
99 .curs_set = head907d_curs_set,
100 .curs_clr = head907d_curs_clr,
101 .base = head917d_base,
102 .ovly = head907d_ovly,
103 .dither = head917d_dither,
104 .procamp = head907d_procamp,