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 {
bool (*olut)(struct nv50_head *, struct nv50_head_atom *, int);
bool olut_identity;
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 (*core_calc)(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;
int head907d_view(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);
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_core_set(struct nv50_head *, struct nv50_head_atom *);
void head907d_core_clr(struct nv50_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)
{
struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
u32 *push;
if ((push = evo_wait(core, 3))) {
evo_mthd(push, 0x0840 + (head->base.index * 0x400), 2);
evo_data(push, 0x80000000 | asyh->olut.mode << 30);
evo_data(push, asyh->olut.offset >> 8);
evo_kick(push, core);
}
struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
const int i = head->base.index;
int ret;
if ((ret = PUSH_WAIT(push, 3)))
return ret;
PUSH_NVSQ(push, NV507D, 0x0840 + (i * 0x400), 0x80000000 | asyh->olut.mode << 30,
0x0844 + (i * 0x400), asyh->olut.offset >> 8);
return 0;
}
static void
......
......@@ -22,6 +22,8 @@
#include "head.h"
#include "core.h"
#include <nvif/push507c.h>
static void
head827d_curs_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)
{
struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
u32 *push;
if ((push = evo_wait(core, 5))) {
evo_mthd(push, 0x0840 + (head->base.index * 0x400), 2);
evo_data(push, 0x80000000 | asyh->olut.mode << 30);
evo_data(push, asyh->olut.offset >> 8);
evo_mthd(push, 0x085c + (head->base.index * 0x400), 1);
evo_data(push, asyh->olut.handle);
evo_kick(push, core);
}
struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
const int i = head->base.index;
int ret;
if ((ret = PUSH_WAIT(push, 5)))
return ret;
PUSH_NVSQ(push, NV827D, 0x0840 + (i * 0x400), 0x80000000 | asyh->olut.mode << 30,
0x0844 + (i * 0x400), asyh->olut.offset >> 8);
PUSH_NVSQ(push, NV827D, 0x085c + (i * 0x400), asyh->olut.handle);
return 0;
}
const struct nv50_head_func
......
......@@ -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)
{
struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
u32 *push;
if ((push = evo_wait(core, 5))) {
evo_mthd(push, 0x0448 + (head->base.index * 0x300), 2);
evo_data(push, 0x80000000 | asyh->olut.mode << 24);
evo_data(push, asyh->olut.offset >> 8);
evo_mthd(push, 0x045c + (head->base.index * 0x300), 1);
evo_data(push, asyh->olut.handle);
evo_kick(push, core);
}
struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
const int i = head->base.index;
int ret;
if ((ret = PUSH_WAIT(push, 5)))
return ret;
PUSH_NVSQ(push, NV907D, 0x0448 + (i * 0x300), 0x80000000 | asyh->olut.mode << 24,
0x044c + (i * 0x300), asyh->olut.offset >> 8);
PUSH_NVSQ(push, NV907D, 0x045c + (i * 0x300), asyh->olut.handle);
return 0;
}
void
......
......@@ -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)
{
struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
u32 *push;
if ((push = evo_wait(core, 4))) {
evo_mthd(push, 0x20a4 + (head->base.index * 0x400), 3);
evo_data(push, asyh->olut.output_mode << 8 |
asyh->olut.range << 4 |
asyh->olut.size);
evo_data(push, asyh->olut.offset >> 8);
evo_data(push, asyh->olut.handle);
evo_kick(push, core);
}
struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
const int i = head->base.index;
int ret;
if ((ret = PUSH_WAIT(push, 4)))
return ret;
PUSH_NVSQ(push, NVC37D, 0x20a4 + (i * 0x400), asyh->olut.output_mode << 8 |
asyh->olut.range << 4 |
asyh->olut.size,
0x20a8 + (i * 0x400), asyh->olut.offset >> 8,
0x20ac + (i * 0x400), asyh->olut.handle);
return 0;
}
static bool
......
......@@ -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)
{
struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan;
u32 *push;
if ((push = evo_wait(core, 4))) {
evo_mthd(push, 0x2280 + (head->base.index * 0x400), 4);
evo_data(push, asyh->olut.size << 8 |
asyh->olut.mode << 2 |
asyh->olut.output_mode);
evo_data(push, 0xffffffff); /* FP_NORM_SCALE. */
evo_data(push, asyh->olut.handle);
evo_data(push, asyh->olut.offset >> 8);
evo_kick(push, core);
}
struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
const int i = head->base.index;
int ret;
if ((ret = PUSH_WAIT(push, 5)))
return ret;
PUSH_NVSQ(push, NVC57D, 0x2280 + (i * 0x400), asyh->olut.size << 8 |
asyh->olut.mode << 2 |
asyh->olut.output_mode,
0x2284 + (i * 0x400), 0xffffffff,
0x2288 + (i * 0x400), asyh->olut.handle,
0x228c + (i * 0x400), asyh->olut.offset >> 8);
return 0;
}
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