Commit a2b7eadf authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/disp: add head class



v2: remove extra whitespace

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 8c7d980d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -762,6 +762,7 @@ static void nv_crtc_destroy(struct drm_crtc *crtc)
	nouveau_bo_unpin(nv_crtc->cursor.nvbo);
	nouveau_bo_ref(NULL, &nv_crtc->cursor.nvbo);
	nvif_notify_dtor(&nv_crtc->vblank);
	nvif_head_dtor(&nv_crtc->head);
	kfree(nv_crtc);
}

@@ -1341,6 +1342,10 @@ nv04_crtc_create(struct drm_device *dev, int crtc_num)

	nv04_cursor_init(nv_crtc);

	ret = nvif_head_ctor(&disp->disp, nv_crtc->base.name, nv_crtc->index, &nv_crtc->head);
	if (ret)
		return ret;

	ret = nvif_notify_ctor(&disp->disp.object, "kmsVbl", nv04_crtc_vblank_handler,
			       false, NV04_DISP_NTFY_VBLANK,
			       &(struct nvif_notify_head_req_v0) {
+5 −0
Original line number Diff line number Diff line
@@ -518,6 +518,7 @@ nv50_head_destroy(struct drm_crtc *crtc)
	struct nv50_head *head = nv50_head(crtc);

	nvif_notify_dtor(&head->base.vblank);
	nvif_head_dtor(&head->base.head);
	nv50_lut_fini(&head->olut);
	drm_crtc_cleanup(crtc);
	kfree(head);
@@ -624,6 +625,10 @@ nv50_head_create(struct drm_device *dev, int index)
		}
	}

	ret = nvif_head_ctor(disp->disp, head->base.base.name, head->base.index, &head->base.head);
	if (ret)
		return ERR_PTR(ret);

	ret = nvif_notify_ctor(&disp->disp->object, "kmsVbl", nv50_head_vblank_handler,
			       false, NV04_DISP_NTFY_VBLANK,
			       &(struct nvif_notify_head_req_v0) {
+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
#define NVIF_CLASS_DISP                              /* if0010.h */  0x80000010
#define NVIF_CLASS_CONN                              /* if0011.h */  0x80000011
#define NVIF_CLASS_OUTP                              /* if0012.h */  0x80000012
#define NVIF_CLASS_HEAD                              /* if0013.h */  0x80000013
#define NVIF_CLASS_DISP_CHAN                         /* if0014.h */  0x80000014

/* the below match nvidia-assigned (either in hw, or sw) class numbers */
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ struct nvif_disp {
	struct nvif_object object;
	unsigned long conn_mask;
	unsigned long outp_mask;
	unsigned long head_mask;
};

int nvif_disp_ctor(struct nvif_device *, const char *name, s32 oclass,
+13 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: MIT */
#ifndef __NVIF_HEAD_H__
#define __NVIF_HEAD_H__
#include <nvif/object.h>
struct nvif_disp;

struct nvif_head {
	struct nvif_object object;
};

int nvif_head_ctor(struct nvif_disp *, const char *name, int id, struct nvif_head *);
void nvif_head_dtor(struct nvif_head *);
#endif
Loading