Commit fc01d1f1 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge branch 'linux-5.9' of git://github.com/skeggsb/linux into drm-next



- Conversion of all push buffer emission to a new set of macros, with
better safety, sanity-checking, debug ability, and the use of NVIDIA's
class headers.  The headers have been trimmed to just what we use as
they're rather extensive, the full versions can be found on NVIDIA's
github[1].
- Proper push buffer space management for EVO/NVD channels.
- Fixes to firmware loading behaviour in odd situations (various
combinations of missing/incompatible FW).
- runpm reference leak fixes
- crc compile fixes without debugfs
- 2MiB system memory pages support on Pascal and newer
- misc other cleanups

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Ben Skeggs <skeggsb@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ <CACAvsv6XYgiXDK6TpvsjMo+8AkrMw7ZxmA=vKk6Gd-xuv6txBA@mail.gmail.com
parents 3afe6766 0059a908
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -32,6 +32,13 @@ nouveau-y += nouveau_vga.o

# DRM - memory management
nouveau-y += nouveau_bo.o
nouveau-y += nouveau_bo0039.o
nouveau-y += nouveau_bo5039.o
nouveau-y += nouveau_bo74c1.o
nouveau-y += nouveau_bo85b5.o
nouveau-y += nouveau_bo9039.o
nouveau-y += nouveau_bo90b5.o
nouveau-y += nouveau_boa0b5.o
nouveau-y += nouveau_gem.o
nouveau-$(CONFIG_DRM_NOUVEAU_SVM) += nouveau_svm.o
nouveau-$(CONFIG_DRM_NOUVEAU_SVM) += nouveau_dmem.o
+8 −0
Original line number Diff line number Diff line
@@ -76,6 +76,14 @@ config NOUVEAU_DEBUG_MMU
	help
	  Say Y here if you want to enable verbose MMU debug output.

config NOUVEAU_DEBUG_PUSH
	bool "Enable additional push buffer debugging"
	depends on DRM_NOUVEAU
	default n
	help
	  Say Y here if you want to enable verbose push buffer debug output
	  and sanity checks.

config DRM_NOUVEAU_BACKLIGHT
	bool "Support for backlight control"
	depends on DRM_NOUVEAU
+15 −15
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@
#include <subdev/bios/pll.h>
#include <subdev/clk.h>

#include <nvif/push006c.h>

#include <nvif/event.h>
#include <nvif/cl0046.h>

@@ -759,7 +761,7 @@ static void nv_crtc_destroy(struct drm_crtc *crtc)
	nouveau_bo_unmap(nv_crtc->cursor.nvbo);
	nouveau_bo_unpin(nv_crtc->cursor.nvbo);
	nouveau_bo_ref(NULL, &nv_crtc->cursor.nvbo);
	nvif_notify_fini(&nv_crtc->vblank);
	nvif_notify_dtor(&nv_crtc->vblank);
	kfree(nv_crtc);
}

@@ -1105,6 +1107,7 @@ nv04_page_flip_emit(struct nouveau_channel *chan,
	struct nouveau_fence_chan *fctx = chan->fence;
	struct nouveau_drm *drm = chan->drm;
	struct drm_device *dev = drm->dev;
	struct nvif_push *push = chan->chan.push;
	unsigned long flags;
	int ret;

@@ -1119,13 +1122,12 @@ nv04_page_flip_emit(struct nouveau_channel *chan,
		goto fail;

	/* Emit the pageflip */
	ret = RING_SPACE(chan, 2);
	ret = PUSH_WAIT(push, 2);
	if (ret)
		goto fail;

	BEGIN_NV04(chan, NvSubSw, NV_SW_PAGE_FLIP, 1);
	OUT_RING  (chan, 0x00000000);
	FIRE_RING (chan);
	PUSH_NVSQ(push, NV_SW, NV_SW_PAGE_FLIP, 0x00000000);
	PUSH_KICK(push);

	ret = nouveau_fence_new(chan, false, pfence);
	if (ret)
@@ -1155,6 +1157,7 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
	struct nouveau_cli *cli;
	struct nouveau_fence *fence;
	struct nv04_display *dispnv04 = nv04_display(dev);
	struct nvif_push *push;
	int head = nouveau_crtc(crtc)->index;
	int ret;

@@ -1162,6 +1165,7 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
	if (!chan)
		return -ENODEV;
	cli = (void *)chan->user.client;
	push = chan->chan.push;

	s = kzalloc(sizeof(*s), GFP_KERNEL);
	if (!s)
@@ -1203,18 +1207,14 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,

	/* Emit a page flip */
	if (swap_interval) {
		ret = RING_SPACE(chan, 8);
		ret = PUSH_WAIT(push, 8);
		if (ret)
			goto fail_unreserve;

		BEGIN_NV04(chan, NvSubImageBlit, 0x012c, 1);
		OUT_RING  (chan, 0);
		BEGIN_NV04(chan, NvSubImageBlit, 0x0134, 1);
		OUT_RING  (chan, head);
		BEGIN_NV04(chan, NvSubImageBlit, 0x0100, 1);
		OUT_RING  (chan, 0);
		BEGIN_NV04(chan, NvSubImageBlit, 0x0130, 1);
		OUT_RING  (chan, 0);
		PUSH_NVSQ(push, NV05F, 0x012c, 0);
		PUSH_NVSQ(push, NV05F, 0x0134, head);
		PUSH_NVSQ(push, NV05F, 0x0100, 0);
		PUSH_NVSQ(push, NV05F, 0x0130, 0);
	}

	nouveau_bo_ref(new_bo, &dispnv04->image[head]);
@@ -1351,7 +1351,7 @@ nv04_crtc_create(struct drm_device *dev, int crtc_num)

	nv04_cursor_init(nv_crtc);

	ret = nvif_notify_init(&disp->disp.object, nv04_crtc_vblank_handler,
	ret = nvif_notify_ctor(&disp->disp.object, "kmsVbl", nv04_crtc_vblank_handler,
			       false, NV04_DISP_NTFY_VBLANK,
			       &(struct nvif_notify_head_req_v0) {
				    .head = nv_crtc->index,
+4 −3
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include "nouveau_connector.h"
#include "nouveau_bo.h"
#include "nouveau_gem.h"
#include "nouveau_chan.h"

#include <nvif/if0004.h>

@@ -178,7 +179,7 @@ nv04_display_destroy(struct drm_device *dev)

	nouveau_hw_save_vga_fonts(dev, 0);

	nvif_notify_fini(&disp->flip);
	nvif_notify_dtor(&disp->flip);

	nouveau_display(dev)->priv = NULL;
	kfree(disp);
@@ -214,8 +215,8 @@ nv04_display_create(struct drm_device *dev)
	dev->driver_features &= ~DRIVER_ATOMIC;

	/* Request page flip completion event. */
	if (drm->nvsw.client) {
		nvif_notify_init(&drm->nvsw, nv04_flip_complete,
	if (drm->channel) {
		nvif_notify_ctor(&drm->channel->nvsw, "kmsFlip", nv04_flip_complete,
				 false, NV04_NVSW_NTFY_UEVENT,
				 NULL, 0, 0, &disp->flip);
	}
+4 −8
Original line number Diff line number Diff line
@@ -11,14 +11,10 @@ int base507c_acquire(struct nv50_wndw *, struct nv50_wndw_atom *,
		     struct nv50_head_atom *);
void base507c_release(struct nv50_wndw *, struct nv50_wndw_atom *,
		      struct nv50_head_atom *);
void base507c_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *);
void base507c_sema_clr(struct nv50_wndw *);
void base507c_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *);
void base507c_ntfy_clr(struct nv50_wndw *);
void base507c_xlut_set(struct nv50_wndw *, struct nv50_wndw_atom *);
void base507c_xlut_clr(struct nv50_wndw *);
void base507c_image_clr(struct nv50_wndw *);
void base507c_update(struct nv50_wndw *, u32 *);
int base507c_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *);
int base507c_sema_clr(struct nv50_wndw *);
int base507c_xlut_set(struct nv50_wndw *, struct nv50_wndw_atom *);
int base507c_xlut_clr(struct nv50_wndw *);

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

Loading