Commit a5df7630 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/kms/nv50-: convert core head_olut_set() to new push macros

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent caa966a7
...@@ -30,7 +30,7 @@ struct nv50_head_func { ...@@ -30,7 +30,7 @@ struct nv50_head_func {
bool (*olut)(struct nv50_head *, struct nv50_head_atom *, int); bool (*olut)(struct nv50_head *, struct nv50_head_atom *, int);
bool olut_identity; bool olut_identity;
int olut_size; int olut_size;
void (*olut_set)(struct nv50_head *, struct nv50_head_atom *); int (*olut_set)(struct nv50_head *, struct nv50_head_atom *);
void (*olut_clr)(struct nv50_head *); void (*olut_clr)(struct nv50_head *);
void (*core_calc)(struct nv50_head *, struct nv50_head_atom *); void (*core_calc)(struct nv50_head *, struct nv50_head_atom *);
void (*core_set)(struct nv50_head *, struct nv50_head_atom *); void (*core_set)(struct nv50_head *, struct nv50_head_atom *);
...@@ -70,7 +70,7 @@ extern const struct nv50_head_func head907d; ...@@ -70,7 +70,7 @@ extern const struct nv50_head_func head907d;
int head907d_view(struct nv50_head *, struct nv50_head_atom *); int head907d_view(struct nv50_head *, struct nv50_head_atom *);
int head907d_mode(struct nv50_head *, struct nv50_head_atom *); int head907d_mode(struct nv50_head *, struct nv50_head_atom *);
bool head907d_olut(struct nv50_head *, struct nv50_head_atom *, int); bool head907d_olut(struct nv50_head *, struct nv50_head_atom *, int);
void head907d_olut_set(struct nv50_head *, struct nv50_head_atom *); int head907d_olut_set(struct nv50_head *, struct nv50_head_atom *);
void head907d_olut_clr(struct nv50_head *); void head907d_olut_clr(struct nv50_head *);
void head907d_core_set(struct nv50_head *, struct nv50_head_atom *); void head907d_core_set(struct nv50_head *, struct nv50_head_atom *);
void head907d_core_clr(struct nv50_head *); void head907d_core_clr(struct nv50_head *);
......
...@@ -243,17 +243,19 @@ head507d_olut_clr(struct nv50_head *head) ...@@ -243,17 +243,19 @@ head507d_olut_clr(struct nv50_head *head)
} }
} }
static void static int
head507d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh) head507d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan; struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
u32 *push; const int i = head->base.index;
if ((push = evo_wait(core, 3))) { int ret;
evo_mthd(push, 0x0840 + (head->base.index * 0x400), 2);
evo_data(push, 0x80000000 | asyh->olut.mode << 30); if ((ret = PUSH_WAIT(push, 3)))
evo_data(push, asyh->olut.offset >> 8); return ret;
evo_kick(push, core);
} PUSH_NVSQ(push, NV507D, 0x0840 + (i * 0x400), 0x80000000 | asyh->olut.mode << 30,
0x0844 + (i * 0x400), asyh->olut.offset >> 8);
return 0;
} }
static void static void
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include "head.h" #include "head.h"
#include "core.h" #include "core.h"
#include <nvif/push507c.h>
static void static void
head827d_curs_clr(struct nv50_head *head) head827d_curs_clr(struct nv50_head *head)
{ {
...@@ -88,19 +90,20 @@ head827d_olut_clr(struct nv50_head *head) ...@@ -88,19 +90,20 @@ head827d_olut_clr(struct nv50_head *head)
} }
} }
static void static int
head827d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh) head827d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan; struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
u32 *push; const int i = head->base.index;
if ((push = evo_wait(core, 5))) { int ret;
evo_mthd(push, 0x0840 + (head->base.index * 0x400), 2);
evo_data(push, 0x80000000 | asyh->olut.mode << 30); if ((ret = PUSH_WAIT(push, 5)))
evo_data(push, asyh->olut.offset >> 8); return ret;
evo_mthd(push, 0x085c + (head->base.index * 0x400), 1);
evo_data(push, asyh->olut.handle); PUSH_NVSQ(push, NV827D, 0x0840 + (i * 0x400), 0x80000000 | asyh->olut.mode << 30,
evo_kick(push, core); 0x0844 + (i * 0x400), asyh->olut.offset >> 8);
} PUSH_NVSQ(push, NV827D, 0x085c + (i * 0x400), asyh->olut.handle);
return 0;
} }
const struct nv50_head_func const struct nv50_head_func
......
...@@ -208,19 +208,20 @@ head907d_olut_clr(struct nv50_head *head) ...@@ -208,19 +208,20 @@ head907d_olut_clr(struct nv50_head *head)
} }
} }
void int
head907d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh) head907d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan; struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
u32 *push; const int i = head->base.index;
if ((push = evo_wait(core, 5))) { int ret;
evo_mthd(push, 0x0448 + (head->base.index * 0x300), 2);
evo_data(push, 0x80000000 | asyh->olut.mode << 24); if ((ret = PUSH_WAIT(push, 5)))
evo_data(push, asyh->olut.offset >> 8); return ret;
evo_mthd(push, 0x045c + (head->base.index * 0x300), 1);
evo_data(push, asyh->olut.handle); PUSH_NVSQ(push, NV907D, 0x0448 + (i * 0x300), 0x80000000 | asyh->olut.mode << 24,
evo_kick(push, core); 0x044c + (i * 0x300), asyh->olut.offset >> 8);
} PUSH_NVSQ(push, NV907D, 0x045c + (i * 0x300), asyh->olut.handle);
return 0;
} }
void void
......
...@@ -137,20 +137,22 @@ headc37d_olut_clr(struct nv50_head *head) ...@@ -137,20 +137,22 @@ headc37d_olut_clr(struct nv50_head *head)
} }
} }
static void static int
headc37d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh) headc37d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan; struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
u32 *push; const int i = head->base.index;
if ((push = evo_wait(core, 4))) { int ret;
evo_mthd(push, 0x20a4 + (head->base.index * 0x400), 3);
evo_data(push, asyh->olut.output_mode << 8 | if ((ret = PUSH_WAIT(push, 4)))
asyh->olut.range << 4 | return ret;
asyh->olut.size);
evo_data(push, asyh->olut.offset >> 8); PUSH_NVSQ(push, NVC37D, 0x20a4 + (i * 0x400), asyh->olut.output_mode << 8 |
evo_data(push, asyh->olut.handle); asyh->olut.range << 4 |
evo_kick(push, core); asyh->olut.size,
} 0x20a8 + (i * 0x400), asyh->olut.offset >> 8,
0x20ac + (i * 0x400), asyh->olut.handle);
return 0;
} }
static bool static bool
......
...@@ -87,21 +87,23 @@ headc57d_olut_clr(struct nv50_head *head) ...@@ -87,21 +87,23 @@ headc57d_olut_clr(struct nv50_head *head)
} }
} }
void static int
headc57d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh) headc57d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan; struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
u32 *push; const int i = head->base.index;
if ((push = evo_wait(core, 4))) { int ret;
evo_mthd(push, 0x2280 + (head->base.index * 0x400), 4);
evo_data(push, asyh->olut.size << 8 | if ((ret = PUSH_WAIT(push, 5)))
asyh->olut.mode << 2 | return ret;
asyh->olut.output_mode);
evo_data(push, 0xffffffff); /* FP_NORM_SCALE. */ PUSH_NVSQ(push, NVC57D, 0x2280 + (i * 0x400), asyh->olut.size << 8 |
evo_data(push, asyh->olut.handle); asyh->olut.mode << 2 |
evo_data(push, asyh->olut.offset >> 8); asyh->olut.output_mode,
evo_kick(push, core); 0x2284 + (i * 0x400), 0xffffffff,
} 0x2288 + (i * 0x400), asyh->olut.handle,
0x228c + (i * 0x400), asyh->olut.offset >> 8);
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