Commit 222439eb authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/kms/nv50-: convert wndw xlut_set() to new push macros

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent cfb4120d
...@@ -13,7 +13,7 @@ void base507c_release(struct nv50_wndw *, struct nv50_wndw_atom *, ...@@ -13,7 +13,7 @@ void base507c_release(struct nv50_wndw *, struct nv50_wndw_atom *,
struct nv50_head_atom *); struct nv50_head_atom *);
int base507c_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *); int base507c_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *);
int base507c_sema_clr(struct nv50_wndw *); int base507c_sema_clr(struct nv50_wndw *);
void base507c_xlut_set(struct nv50_wndw *, struct nv50_wndw_atom *); int base507c_xlut_set(struct nv50_wndw *, struct nv50_wndw_atom *);
void base507c_xlut_clr(struct nv50_wndw *); void base507c_xlut_clr(struct nv50_wndw *);
void base507c_image_clr(struct nv50_wndw *); void base507c_image_clr(struct nv50_wndw *);
void base507c_update(struct nv50_wndw *, u32 *); void base507c_update(struct nv50_wndw *, u32 *);
......
...@@ -100,15 +100,17 @@ base507c_xlut_clr(struct nv50_wndw *wndw) ...@@ -100,15 +100,17 @@ base507c_xlut_clr(struct nv50_wndw *wndw)
} }
} }
void int
base507c_xlut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) base507c_xlut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{ {
u32 *push; struct nvif_push *push = wndw->wndw.push;
if ((push = evo_wait(&wndw->wndw, 2))) { int ret;
evo_mthd(push, 0x00e0, 1);
evo_data(push, 0x40000000); if ((ret = PUSH_WAIT(push, 2)))
evo_kick(push, &wndw->wndw); return ret;
}
PUSH_NVSQ(push, NV507C, 0x00e0, 0x40000000);
return 0;
} }
int int
......
...@@ -61,20 +61,21 @@ base907c_xlut_clr(struct nv50_wndw *wndw) ...@@ -61,20 +61,21 @@ base907c_xlut_clr(struct nv50_wndw *wndw)
} }
} }
static void static int
base907c_xlut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) base907c_xlut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{ {
u32 *push; struct nvif_push *push = wndw->wndw.push;
if ((push = evo_wait(&wndw->wndw, 6))) { int ret;
evo_mthd(push, 0x00e0, 3);
evo_data(push, asyw->xlut.i.enable << 30 | if ((ret = PUSH_WAIT(push, 6)))
asyw->xlut.i.mode << 24); return ret;
evo_data(push, asyw->xlut.i.offset >> 8);
evo_data(push, 0x40000000); PUSH_NVSQ(push, NV907C, 0x00e0, asyw->xlut.i.enable << 30 |
evo_mthd(push, 0x00fc, 1); asyw->xlut.i.mode << 24,
evo_data(push, asyw->xlut.handle); 0x00e4, asyw->xlut.i.offset >> 8,
evo_kick(push, &wndw->wndw); 0x00e8, 0x40000000);
} PUSH_NVSQ(push, NV907C, 0x00fc, asyw->xlut.handle);
return 0;
} }
static bool static bool
......
...@@ -72,7 +72,7 @@ struct nv50_wndw_func { ...@@ -72,7 +72,7 @@ struct nv50_wndw_func {
bool ilut_identity; bool ilut_identity;
int ilut_size; int ilut_size;
bool olut_core; bool olut_core;
void (*xlut_set)(struct nv50_wndw *, struct nv50_wndw_atom *); int (*xlut_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
void (*xlut_clr)(struct nv50_wndw *); void (*xlut_clr)(struct nv50_wndw *);
void (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *); void (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
void (*image_clr)(struct nv50_wndw *); void (*image_clr)(struct nv50_wndw *);
......
...@@ -59,19 +59,21 @@ wndwc37e_ilut_clr(struct nv50_wndw *wndw) ...@@ -59,19 +59,21 @@ wndwc37e_ilut_clr(struct nv50_wndw *wndw)
} }
} }
static void static int
wndwc37e_ilut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) wndwc37e_ilut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{ {
u32 *push; struct nvif_push *push = wndw->wndw.push;
if ((push = evo_wait(&wndw->wndw, 4))) { int ret;
evo_mthd(push, 0x02b0, 3);
evo_data(push, asyw->xlut.i.output_mode << 8 | if ((ret = PUSH_WAIT(push, 4)))
return ret;
PUSH_NVSQ(push, NVC37E, 0x02b0, asyw->xlut.i.output_mode << 8 |
asyw->xlut.i.range << 4 | asyw->xlut.i.range << 4 |
asyw->xlut.i.size); asyw->xlut.i.size,
evo_data(push, asyw->xlut.i.offset >> 8); 0x02b4, asyw->xlut.i.offset >> 8,
evo_data(push, asyw->xlut.handle); 0x02b8, asyw->xlut.handle);
evo_kick(push, &wndw->wndw); return 0;
}
} }
static bool static bool
......
...@@ -103,19 +103,21 @@ wndwc57e_ilut_clr(struct nv50_wndw *wndw) ...@@ -103,19 +103,21 @@ wndwc57e_ilut_clr(struct nv50_wndw *wndw)
} }
} }
static void static int
wndwc57e_ilut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) wndwc57e_ilut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{ {
u32 *push; struct nvif_push *push = wndw->wndw.push;
if ((push = evo_wait(&wndw->wndw, 4))) { int ret;
evo_mthd(push, 0x0440, 3);
evo_data(push, asyw->xlut.i.size << 8 | if ((ret = PUSH_WAIT(push, 4)))
return ret;
PUSH_NVSQ(push, NVC57E, 0x0440, asyw->xlut.i.size << 8 |
asyw->xlut.i.mode << 2 | asyw->xlut.i.mode << 2 |
asyw->xlut.i.output_mode); asyw->xlut.i.output_mode,
evo_data(push, asyw->xlut.handle); 0x0444, asyw->xlut.handle,
evo_data(push, asyw->xlut.i.offset >> 8); 0x0448, asyw->xlut.i.offset >> 8);
evo_kick(push, &wndw->wndw); return 0;
}
} }
static u16 static u16
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment