Commit 53e0a3e7 authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/kms/nv50-: simplify tracking of channel interlocks



Instead of windows returning their core channel interlock mask if they
know core has been modified, it's recorded unconditionally and used if
required when update methods are emitted.

This will be required to support Volta.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 34508f9d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -29,9 +29,12 @@ nouveau-y += dispnv50/base907c.o

nouveau-y += dispnv50/curs.o
nouveau-y += dispnv50/curs507a.o
nouveau-y += dispnv50/curs907a.o

nouveau-y += dispnv50/oimm.o
nouveau-y += dispnv50/oimm507b.o

nouveau-y += dispnv50/ovly.o
nouveau-y += dispnv50/ovly507e.o
nouveau-y += dispnv50/ovly827e.o
nouveau-y += dispnv50/ovly907e.o
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
int base507c_new(struct nouveau_drm *, int, s32, struct nv50_wndw **);
int base507c_new_(const struct nv50_wndw_func *, const u32 *format,
		  struct nouveau_drm *, int head, s32 oclass,
		  struct nv50_wndw **);
		  u32 interlock_data, struct nv50_wndw **);
extern const u32 base507c_format[];
int base507c_acquire(struct nv50_wndw *, struct nv50_wndw_atom *,
		     struct nv50_head_atom *);
@@ -19,7 +19,7 @@ void base507c_ntfy_clr(struct nv50_wndw *);
int base507c_ntfy_wait_begun(struct nouveau_bo *, u32, struct nvif_device *);
void base507c_image_clr(struct nv50_wndw *);
void base507c_lut(struct nv50_wndw *, struct nv50_wndw_atom *);
u32 base507c_update(struct nv50_wndw *, u32);
void base507c_update(struct nv50_wndw *, u32 *);

int base827c_new(struct nouveau_drm *, int, s32, struct nv50_wndw **);

+8 −8
Original line number Diff line number Diff line
@@ -28,17 +28,15 @@
#include <drm/drm_plane_helper.h>
#include "nouveau_bo.h"

u32
base507c_update(struct nv50_wndw *wndw, u32 interlock)
void
base507c_update(struct nv50_wndw *wndw, u32 *interlock)
{
	u32 *push;
	if ((push = evo_wait(&wndw->wndw, 2))) {
		evo_mthd(push, 0x0080, 1);
		evo_data(push, interlock);
		evo_data(push, interlock[NV50_DISP_INTERLOCK_CORE]);
		evo_kick(push, &wndw->wndw);
		return interlock ? 2 << (wndw->id * 8) : 0;
	}
	return 0;
}

void
@@ -224,7 +222,7 @@ base507c = {

int
base507c_new_(const struct nv50_wndw_func *func, const u32 *format,
	      struct nouveau_drm *drm, int head, s32 oclass,
	      struct nouveau_drm *drm, int head, s32 oclass, u32 interlock_data,
	      struct nv50_wndw **pwndw)
{
	struct nv50_disp_base_channel_dma_v0 args = {
@@ -235,7 +233,8 @@ base507c_new_(const struct nv50_wndw_func *func, const u32 *format,
	int ret;

	ret = nv50_wndw_new_(func, drm->dev, DRM_PLANE_TYPE_PRIMARY,
			     "base", head, format, BIT(head), &wndw);
			     "base", head, format, BIT(head),
			     NV50_DISP_INTERLOCK_BASE, interlock_data, &wndw);
	if (*pwndw = wndw, ret)
		return ret;

@@ -266,5 +265,6 @@ int
base507c_new(struct nouveau_drm *drm, int head, s32 oclass,
	     struct nv50_wndw **pwndw)
{
	return base507c_new_(&base507c, base507c_format, drm, head, oclass, pwndw);
	return base507c_new_(&base507c, base507c_format, drm, head, oclass,
			     0x00000002 << (head * 8), pwndw);
}
+2 −1
Original line number Diff line number Diff line
@@ -63,5 +63,6 @@ int
base827c_new(struct nouveau_drm *drm, int head, s32 oclass,
	     struct nv50_wndw **pwndw)
{
	return base507c_new_(&base827c, base507c_format, drm, head, oclass, pwndw);
	return base507c_new_(&base827c, base507c_format, drm, head, oclass,
			     0x00000002 << (head * 8), pwndw);
}
+3 −15
Original line number Diff line number Diff line
@@ -21,19 +21,6 @@
 */
#include "base.h"

static u32
base907c_update(struct nv50_wndw *wndw, u32 interlock)
{
	u32 *push;
	if ((push = evo_wait(&wndw->wndw, 2))) {
		evo_mthd(push, 0x0080, 1);
		evo_data(push, interlock);
		evo_kick(push, &wndw->wndw);
		return interlock ? 2 << (wndw->id * 4) : 0;
	}
	return 0;
}

static void
base907c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{
@@ -69,12 +56,13 @@ base907c = {
	.image_set = base907c_image_set,
	.image_clr = base507c_image_clr,
	.lut = base507c_lut,
	.update = base907c_update,
	.update = base507c_update,
};

int
base907c_new(struct nouveau_drm *drm, int head, s32 oclass,
	     struct nv50_wndw **pwndw)
{
	return base507c_new_(&base907c, base507c_format, drm, head, oclass, pwndw);
	return base507c_new_(&base907c, base507c_format, drm, head, oclass,
			     0x00000002 << (head * 4), pwndw);
}
Loading