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

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
This commit is contained in:
Ben Skeggs 2020-06-21 09:28:36 +10:00
parent 246db5fd38
commit ff37116ea4
4 changed files with 69 additions and 64 deletions

View File

@ -45,7 +45,7 @@ struct nv50_head_func {
int (*ovly)(struct nv50_head *, struct nv50_head_atom *); int (*ovly)(struct nv50_head *, struct nv50_head_atom *);
int (*dither)(struct nv50_head *, struct nv50_head_atom *); int (*dither)(struct nv50_head *, struct nv50_head_atom *);
int (*procamp)(struct nv50_head *, struct nv50_head_atom *); int (*procamp)(struct nv50_head *, struct nv50_head_atom *);
void (*or)(struct nv50_head *, struct nv50_head_atom *); int (*or)(struct nv50_head *, struct nv50_head_atom *);
void (*static_wndw_map)(struct nv50_head *, struct nv50_head_atom *); void (*static_wndw_map)(struct nv50_head *, struct nv50_head_atom *);
}; };
@ -78,7 +78,7 @@ int head907d_curs_set(struct nv50_head *, struct nv50_head_atom *);
int head907d_curs_clr(struct nv50_head *); int head907d_curs_clr(struct nv50_head *);
int head907d_ovly(struct nv50_head *, struct nv50_head_atom *); int head907d_ovly(struct nv50_head *, struct nv50_head_atom *);
int head907d_procamp(struct nv50_head *, struct nv50_head_atom *); int head907d_procamp(struct nv50_head *, struct nv50_head_atom *);
void head907d_or(struct nv50_head *, struct nv50_head_atom *); int head907d_or(struct nv50_head *, struct nv50_head_atom *);
extern const struct nv50_head_func head917d; extern const struct nv50_head_func head917d;
int head917d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *, int head917d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,

View File

@ -31,21 +31,24 @@
#include <nvif/push507c.h> #include <nvif/push507c.h>
void int
head907d_or(struct nv50_head *head, struct nv50_head_atom *asyh) head907d_or(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, 0x0404 + (head->base.index * 0x300), 2);
evo_data(push, asyh->or.depth << 6 | if ((ret = PUSH_WAIT(push, 3)))
asyh->or.nvsync << 4 | return ret;
asyh->or.nhsync << 3 |
asyh->or.crc_raster); PUSH_NVSQ(push, NV907D, 0x0404 + (i * 0x300), asyh->or.depth << 6 |
evo_data(push, 0x31ec6000 | head->base.index << 25 | asyh->or.nvsync << 4 |
asyh->mode.interlace); asyh->or.nhsync << 3 |
evo_kick(push, core); asyh->or.crc_raster,
} 0x0408 + (i * 0x300), 0x31ec6000 |
head->base.index << 25 |
asyh->mode.interlace);
return 0;
} }
int int

View File

@ -25,35 +25,36 @@
#include <nvif/pushc37b.h> #include <nvif/pushc37b.h>
static void static int
headc37d_or(struct nv50_head *head, struct nv50_head_atom *asyh) headc37d_or(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;
const int i = head->base.index;
u8 depth; u8 depth;
u32 *push; int ret;
if ((push = evo_wait(core, 2))) { /*XXX: This is a dirty hack until OR depth handling is
/*XXX: This is a dirty hack until OR depth handling is * improved later for deep colour etc.
* improved later for deep colour etc. */
*/ switch (asyh->or.depth) {
switch (asyh->or.depth) { case 6: depth = 5; break;
case 6: depth = 5; break; case 5: depth = 4; break;
case 5: depth = 4; break; case 2: depth = 1; break;
case 2: depth = 1; break; case 0: depth = 4; break;
case 0: depth = 4; break; default:
default: depth = asyh->or.depth;
depth = asyh->or.depth; WARN_ON(1);
WARN_ON(1); break;
break;
}
evo_mthd(push, 0x2004 + (head->base.index * 0x400), 1);
evo_data(push, depth << 4 |
asyh->or.nvsync << 3 |
asyh->or.nhsync << 2 |
asyh->or.crc_raster);
evo_kick(push, core);
} }
if ((ret = PUSH_WAIT(push, 2)))
return ret;
PUSH_NVSQ(push, NVC37D, 0x2004 + (i * 0x400), depth << 4 |
asyh->or.nvsync << 3 |
asyh->or.nhsync << 2 |
asyh->or.crc_raster);
return 0;
} }
static int static int

View File

@ -25,36 +25,37 @@
#include <nvif/pushc37b.h> #include <nvif/pushc37b.h>
static void static int
headc57d_or(struct nv50_head *head, struct nv50_head_atom *asyh) headc57d_or(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;
const int i = head->base.index;
u8 depth; u8 depth;
u32 *push; int ret;
if ((push = evo_wait(core, 2))) { /*XXX: This is a dirty hack until OR depth handling is
/*XXX: This is a dirty hack until OR depth handling is * improved later for deep colour etc.
* improved later for deep colour etc. */
*/ switch (asyh->or.depth) {
switch (asyh->or.depth) { case 6: depth = 5; break;
case 6: depth = 5; break; case 5: depth = 4; break;
case 5: depth = 4; break; case 2: depth = 1; break;
case 2: depth = 1; break; case 0: depth = 4; break;
case 0: depth = 4; break; default:
default: depth = asyh->or.depth;
depth = asyh->or.depth; WARN_ON(1);
WARN_ON(1); break;
break;
}
evo_mthd(push, 0x2004 + (head->base.index * 0x400), 1);
evo_data(push, 0xfc000000 |
depth << 4 |
asyh->or.nvsync << 3 |
asyh->or.nhsync << 2 |
asyh->or.crc_raster);
evo_kick(push, core);
} }
if ((ret = PUSH_WAIT(push, 2)))
return ret;
PUSH_NVSQ(push, NVC57D, 0x2004 + (i * 0x400), 0xfc000000 |
depth << 4 |
asyh->or.nvsync << 3 |
asyh->or.nhsync << 2 |
asyh->or.crc_raster);
return 0;
} }
static int static int