Commit 72587dca authored by Ben Skeggs's avatar Ben Skeggs

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

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent bcae99c2
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
*/ */
#include "base.h" #include "base.h"
#include <nvif/push507c.h>
static void static void
base907c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) base907c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{ {
...@@ -136,17 +138,18 @@ base907c_csc_clr(struct nv50_wndw *wndw) ...@@ -136,17 +138,18 @@ base907c_csc_clr(struct nv50_wndw *wndw)
} }
} }
static void static int
base907c_csc_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) base907c_csc_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{ {
u32 *push, i; struct nvif_push *push = wndw->wndw.push;
if ((push = evo_wait(&wndw->wndw, 13))) { int ret;
evo_mthd(push, 0x0140, 12);
evo_data(push, asyw->csc.matrix[0] | 0x80000000); if ((ret = PUSH_WAIT(push, 13)))
for (i = 1; i < 12; i++) return ret;
evo_data(push, asyw->csc.matrix[i]);
evo_kick(push, &wndw->wndw); PUSH_NVSQ(push, NV907C, 0x0140, asyw->csc.matrix[0] | 0x80000000,
} 0x0144, &asyw->csc.matrix[1], 11);
return 0;
} }
const struct nv50_wndw_func const struct nv50_wndw_func
......
...@@ -67,7 +67,7 @@ struct nv50_wndw_func { ...@@ -67,7 +67,7 @@ struct nv50_wndw_func {
bool (*ilut)(struct nv50_wndw *, struct nv50_wndw_atom *, int); bool (*ilut)(struct nv50_wndw *, struct nv50_wndw_atom *, int);
void (*csc)(struct nv50_wndw *, struct nv50_wndw_atom *, void (*csc)(struct nv50_wndw *, struct nv50_wndw_atom *,
const struct drm_color_ctm *); const struct drm_color_ctm *);
void (*csc_set)(struct nv50_wndw *, struct nv50_wndw_atom *); int (*csc_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
void (*csc_clr)(struct nv50_wndw *); void (*csc_clr)(struct nv50_wndw *);
bool ilut_identity; bool ilut_identity;
int ilut_size; int ilut_size;
......
...@@ -34,16 +34,17 @@ wndwc37e_csc_clr(struct nv50_wndw *wndw) ...@@ -34,16 +34,17 @@ wndwc37e_csc_clr(struct nv50_wndw *wndw)
{ {
} }
static void static int
wndwc37e_csc_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) wndwc37e_csc_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{ {
u32 *push, i; struct nvif_push *push = wndw->wndw.push;
if ((push = evo_wait(&wndw->wndw, 13))) { int ret;
evo_mthd(push, 0x02bc, 12);
for (i = 0; i < 12; i++) if ((ret = PUSH_WAIT(push, 13)))
evo_data(push, asyw->csc.matrix[i]); return ret;
evo_kick(push, &wndw->wndw);
} PUSH_NVSQ(push, NVC37E, 0x02bc, asyw->csc.matrix, 12);
return 0;
} }
static void static void
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <nouveau_bo.h> #include <nouveau_bo.h>
#include <nvif/clc37e.h> #include <nvif/clc37e.h>
#include <nvif/pushc37b.h>
static void static void
wndwc57e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) wndwc57e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
...@@ -82,16 +83,17 @@ wndwc57e_csc_clr(struct nv50_wndw *wndw) ...@@ -82,16 +83,17 @@ wndwc57e_csc_clr(struct nv50_wndw *wndw)
} }
} }
static void static int
wndwc57e_csc_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) wndwc57e_csc_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{ {
u32 *push, i; struct nvif_push *push = wndw->wndw.push;
if ((push = evo_wait(&wndw->wndw, 13))) { int ret;
evo_mthd(push, 0x0400, 12);
for (i = 0; i < 12; i++) if ((ret = PUSH_WAIT(push, 13)))
evo_data(push, asyw->csc.matrix[i]); return ret;
evo_kick(push, &wndw->wndw);
} PUSH_NVSQ(push, NVC57E, 0x0400, asyw->csc.matrix, 12);
return 0;
} }
static void static void
......
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