xref: /openbmc/linux/drivers/gpu/drm/nouveau/dispnv50/head917d.c (revision 09e1b78aab5715eacab02e4047c7a47d72f6a1e9)
1*09e1b78aSBen Skeggs /*
2*09e1b78aSBen Skeggs  * Copyright 2018 Red Hat Inc.
3*09e1b78aSBen Skeggs  *
4*09e1b78aSBen Skeggs  * Permission is hereby granted, free of charge, to any person obtaining a
5*09e1b78aSBen Skeggs  * copy of this software and associated documentation files (the "Software"),
6*09e1b78aSBen Skeggs  * to deal in the Software without restriction, including without limitation
7*09e1b78aSBen Skeggs  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*09e1b78aSBen Skeggs  * and/or sell copies of the Software, and to permit persons to whom the
9*09e1b78aSBen Skeggs  * Software is furnished to do so, subject to the following conditions:
10*09e1b78aSBen Skeggs  *
11*09e1b78aSBen Skeggs  * The above copyright notice and this permission notice shall be included in
12*09e1b78aSBen Skeggs  * all copies or substantial portions of the Software.
13*09e1b78aSBen Skeggs  *
14*09e1b78aSBen Skeggs  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*09e1b78aSBen Skeggs  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*09e1b78aSBen Skeggs  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17*09e1b78aSBen Skeggs  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18*09e1b78aSBen Skeggs  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19*09e1b78aSBen Skeggs  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20*09e1b78aSBen Skeggs  * OTHER DEALINGS IN THE SOFTWARE.
21*09e1b78aSBen Skeggs  */
22*09e1b78aSBen Skeggs #include "head.h"
23*09e1b78aSBen Skeggs #include "core.h"
24*09e1b78aSBen Skeggs 
25*09e1b78aSBen Skeggs static void
26*09e1b78aSBen Skeggs head917d_dither(struct nv50_head *head, struct nv50_head_atom *asyh)
27*09e1b78aSBen Skeggs {
28*09e1b78aSBen Skeggs 	struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
29*09e1b78aSBen Skeggs 	u32 *push;
30*09e1b78aSBen Skeggs 	if ((push = evo_wait(core, 2))) {
31*09e1b78aSBen Skeggs 		evo_mthd(push, 0x04a0 + (head->base.index * 0x0300), 1);
32*09e1b78aSBen Skeggs 		evo_data(push, asyh->dither.mode << 3 |
33*09e1b78aSBen Skeggs 			       asyh->dither.bits << 1 |
34*09e1b78aSBen Skeggs 			       asyh->dither.enable);
35*09e1b78aSBen Skeggs 		evo_kick(push, core);
36*09e1b78aSBen Skeggs 	}
37*09e1b78aSBen Skeggs }
38*09e1b78aSBen Skeggs 
39*09e1b78aSBen Skeggs const struct nv50_head_func
40*09e1b78aSBen Skeggs head917d = {
41*09e1b78aSBen Skeggs 	.view = head907d_view,
42*09e1b78aSBen Skeggs 	.mode = head907d_mode,
43*09e1b78aSBen Skeggs 	.ilut_set = head907d_ilut_set,
44*09e1b78aSBen Skeggs 	.ilut_clr = head907d_ilut_clr,
45*09e1b78aSBen Skeggs 	.core_calc = head507d_core_calc,
46*09e1b78aSBen Skeggs 	.core_set = head907d_core_set,
47*09e1b78aSBen Skeggs 	.core_clr = head907d_core_clr,
48*09e1b78aSBen Skeggs 	.curs_set = head907d_curs_set,
49*09e1b78aSBen Skeggs 	.curs_clr = head907d_curs_clr,
50*09e1b78aSBen Skeggs 	.base = head907d_base,
51*09e1b78aSBen Skeggs 	.ovly = head907d_ovly,
52*09e1b78aSBen Skeggs 	.dither = head917d_dither,
53*09e1b78aSBen Skeggs 	.procamp = head907d_procamp,
54*09e1b78aSBen Skeggs 	.or = head907d_or,
55*09e1b78aSBen Skeggs };
56