Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14187b00 authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/disp: move vblank_{get,put} methods into nvkm_head



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent a1c93078
Loading
Loading
Loading
Loading
+8 −4
Original line number Original line Diff line number Diff line
@@ -38,17 +38,21 @@
#include <nvif/unpack.h>
#include <nvif/unpack.h>


static void
static void
nvkm_disp_vblank_fini(struct nvkm_event *event, int type, int head)
nvkm_disp_vblank_fini(struct nvkm_event *event, int type, int id)
{
{
	struct nvkm_disp *disp = container_of(event, typeof(*disp), vblank);
	struct nvkm_disp *disp = container_of(event, typeof(*disp), vblank);
	disp->func->head.vblank_fini(disp, head);
	struct nvkm_head *head = nvkm_head_find(disp, id);
	if (head)
		head->func->vblank_put(head);
}
}


static void
static void
nvkm_disp_vblank_init(struct nvkm_event *event, int type, int head)
nvkm_disp_vblank_init(struct nvkm_event *event, int type, int id)
{
{
	struct nvkm_disp *disp = container_of(event, typeof(*disp), vblank);
	struct nvkm_disp *disp = container_of(event, typeof(*disp), vblank);
	disp->func->head.vblank_init(disp, head);
	struct nvkm_head *head = nvkm_head_find(disp, id);
	if (head)
		head->func->vblank_get(head);
}
}


static int
static int
+0 −2
Original line number Original line Diff line number Diff line
@@ -32,8 +32,6 @@ g84_disp = {
	.super = nv50_disp_super,
	.super = nv50_disp_super,
	.root = &g84_disp_root_oclass,
	.root = &g84_disp_root_oclass,
	.head.new = nv50_head_new,
	.head.new = nv50_head_new,
	.head.vblank_init = nv50_disp_vblank_init,
	.head.vblank_fini = nv50_disp_vblank_fini,
	.head.scanoutpos = nv50_disp_root_scanoutpos,
	.head.scanoutpos = nv50_disp_root_scanoutpos,
	.outp.internal.crt = nv50_dac_output_new,
	.outp.internal.crt = nv50_dac_output_new,
	.outp.internal.tmds = nv50_sor_output_new,
	.outp.internal.tmds = nv50_sor_output_new,
+0 −2
Original line number Original line Diff line number Diff line
@@ -32,8 +32,6 @@ g94_disp = {
	.super = nv50_disp_super,
	.super = nv50_disp_super,
	.root = &g94_disp_root_oclass,
	.root = &g94_disp_root_oclass,
	.head.new = nv50_head_new,
	.head.new = nv50_head_new,
	.head.vblank_init = nv50_disp_vblank_init,
	.head.vblank_fini = nv50_disp_vblank_fini,
	.head.scanoutpos = nv50_disp_root_scanoutpos,
	.head.scanoutpos = nv50_disp_root_scanoutpos,
	.outp.internal.crt = nv50_dac_output_new,
	.outp.internal.crt = nv50_dac_output_new,
	.outp.internal.tmds = nv50_sor_output_new,
	.outp.internal.tmds = nv50_sor_output_new,
+0 −16
Original line number Original line Diff line number Diff line
@@ -31,20 +31,6 @@
#include <subdev/bios/pll.h>
#include <subdev/bios/pll.h>
#include <subdev/devinit.h>
#include <subdev/devinit.h>


void
gf119_disp_vblank_init(struct nv50_disp *disp, int head)
{
	struct nvkm_device *device = disp->base.engine.subdev.device;
	nvkm_mask(device, 0x6100c0 + (head * 0x800), 0x00000001, 0x00000001);
}

void
gf119_disp_vblank_fini(struct nv50_disp *disp, int head)
{
	struct nvkm_device *device = disp->base.engine.subdev.device;
	nvkm_mask(device, 0x6100c0 + (head * 0x800), 0x00000001, 0x00000000);
}

static struct nvkm_output *
static struct nvkm_output *
exec_lookup(struct nv50_disp *disp, int head, int or, u32 ctrl,
exec_lookup(struct nv50_disp *disp, int head, int or, u32 ctrl,
	    u32 *data, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
	    u32 *data, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
@@ -515,8 +501,6 @@ gf119_disp = {
	.super = gf119_disp_super,
	.super = gf119_disp_super,
	.root = &gf119_disp_root_oclass,
	.root = &gf119_disp_root_oclass,
	.head.new = gf119_head_new,
	.head.new = gf119_head_new,
	.head.vblank_init = gf119_disp_vblank_init,
	.head.vblank_fini = gf119_disp_vblank_fini,
	.head.scanoutpos = gf119_disp_root_scanoutpos,
	.head.scanoutpos = gf119_disp_root_scanoutpos,
	.outp.internal.crt = nv50_dac_output_new,
	.outp.internal.crt = nv50_dac_output_new,
	.outp.internal.tmds = nv50_sor_output_new,
	.outp.internal.tmds = nv50_sor_output_new,
+0 −2
Original line number Original line Diff line number Diff line
@@ -33,8 +33,6 @@ gk104_disp = {
	.super = gf119_disp_super,
	.super = gf119_disp_super,
	.root = &gk104_disp_root_oclass,
	.root = &gk104_disp_root_oclass,
	.head.new = gf119_head_new,
	.head.new = gf119_head_new,
	.head.vblank_init = gf119_disp_vblank_init,
	.head.vblank_fini = gf119_disp_vblank_fini,
	.head.scanoutpos = gf119_disp_root_scanoutpos,
	.head.scanoutpos = gf119_disp_root_scanoutpos,
	.outp.internal.crt = nv50_dac_output_new,
	.outp.internal.crt = nv50_dac_output_new,
	.outp.internal.tmds = nv50_sor_output_new,
	.outp.internal.tmds = nv50_sor_output_new,
Loading