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

Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm-next



This time mostly cleanups around the runtime power management handling
and slightly improved GPU hang handling. Also some additions to the
HWDB to get the driver working properly on more NXP i.MX8MP IP cores.

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Lucas Stach <l.stach@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/f40c65f7ecfde2e61f1a6d7fd463f6f739bc0dd1.camel@pengutronix.de
parents a8b273a8 88c31d2d
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -53,11 +53,12 @@ static inline void CMD_END(struct etnaviv_cmdbuf *buffer)
	OUT(buffer, VIV_FE_END_HEADER_OP_END);
}

static inline void CMD_WAIT(struct etnaviv_cmdbuf *buffer)
static inline void CMD_WAIT(struct etnaviv_cmdbuf *buffer,
			    unsigned int waitcycles)
{
	buffer->user_size = ALIGN(buffer->user_size, 8);

	OUT(buffer, VIV_FE_WAIT_HEADER_OP_WAIT | 200);
	OUT(buffer, VIV_FE_WAIT_HEADER_OP_WAIT | waitcycles);
}

static inline void CMD_LINK(struct etnaviv_cmdbuf *buffer,
@@ -168,7 +169,7 @@ u16 etnaviv_buffer_init(struct etnaviv_gpu *gpu)
	/* initialize buffer */
	buffer->user_size = 0;

	CMD_WAIT(buffer);
	CMD_WAIT(buffer, gpu->fe_waitcycles);
	CMD_LINK(buffer, 2,
		 etnaviv_cmdbuf_get_va(buffer, &gpu->mmu_context->cmdbuf_mapping)
		 + buffer->user_size - 4);
@@ -320,7 +321,7 @@ void etnaviv_sync_point_queue(struct etnaviv_gpu *gpu, unsigned int event)
	CMD_END(buffer);

	/* Append waitlink */
	CMD_WAIT(buffer);
	CMD_WAIT(buffer, gpu->fe_waitcycles);
	CMD_LINK(buffer, 2,
		 etnaviv_cmdbuf_get_va(buffer, &gpu->mmu_context->cmdbuf_mapping)
		 + buffer->user_size - 4);
@@ -503,7 +504,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 exec_state,

	CMD_LOAD_STATE(buffer, VIVS_GL_EVENT, VIVS_GL_EVENT_EVENT_ID(event) |
		       VIVS_GL_EVENT_FROM_PE);
	CMD_WAIT(buffer);
	CMD_WAIT(buffer, gpu->fe_waitcycles);
	CMD_LINK(buffer, 2,
		 etnaviv_cmdbuf_get_va(buffer, &gpu->mmu_context->cmdbuf_mapping)
		 + buffer->user_size - 4);
+3 −0
Original line number Diff line number Diff line
@@ -121,6 +121,9 @@ void etnaviv_cmdbuf_free(struct etnaviv_cmdbuf *cmdbuf)
	int order = order_base_2(ALIGN(cmdbuf->size, SUBALLOC_GRANULE) /
				 SUBALLOC_GRANULE);

	if (!suballoc)
		return;

	mutex_lock(&suballoc->lock);
	bitmap_release_region(suballoc->granule_map,
			      cmdbuf->suballoc_offset / SUBALLOC_GRANULE,
+3 −1
Original line number Diff line number Diff line
@@ -6,7 +6,9 @@
#include <linux/component.h>
#include <linux/dma-mapping.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/uaccess.h>

#include <drm/drm_debugfs.h>
+7 −7
Original line number Diff line number Diff line
@@ -130,9 +130,9 @@ void etnaviv_core_dump(struct etnaviv_gem_submit *submit)
		return;
	etnaviv_dump_core = false;

	mutex_lock(&gpu->mmu_context->lock);
	mutex_lock(&submit->mmu_context->lock);

	mmu_size = etnaviv_iommu_dump_size(gpu->mmu_context);
	mmu_size = etnaviv_iommu_dump_size(submit->mmu_context);

	/* We always dump registers, mmu, ring, hanging cmdbuf and end marker */
	n_obj = 5;
@@ -162,7 +162,7 @@ void etnaviv_core_dump(struct etnaviv_gem_submit *submit)
	iter.start = __vmalloc(file_size, GFP_KERNEL | __GFP_NOWARN |
			__GFP_NORETRY);
	if (!iter.start) {
		mutex_unlock(&gpu->mmu_context->lock);
		mutex_unlock(&submit->mmu_context->lock);
		dev_warn(gpu->dev, "failed to allocate devcoredump file\n");
		return;
	}
@@ -174,18 +174,18 @@ void etnaviv_core_dump(struct etnaviv_gem_submit *submit)
	memset(iter.hdr, 0, iter.data - iter.start);

	etnaviv_core_dump_registers(&iter, gpu);
	etnaviv_core_dump_mmu(&iter, gpu->mmu_context, mmu_size);
	etnaviv_core_dump_mmu(&iter, submit->mmu_context, mmu_size);
	etnaviv_core_dump_mem(&iter, ETDUMP_BUF_RING, gpu->buffer.vaddr,
			      gpu->buffer.size,
			      etnaviv_cmdbuf_get_va(&gpu->buffer,
					&gpu->mmu_context->cmdbuf_mapping));
					&submit->mmu_context->cmdbuf_mapping));

	etnaviv_core_dump_mem(&iter, ETDUMP_BUF_CMD,
			      submit->cmdbuf.vaddr, submit->cmdbuf.size,
			      etnaviv_cmdbuf_get_va(&submit->cmdbuf,
					&gpu->mmu_context->cmdbuf_mapping));
					&submit->mmu_context->cmdbuf_mapping));

	mutex_unlock(&gpu->mmu_context->lock);
	mutex_unlock(&submit->mmu_context->lock);

	/* Reserve space for the bomap */
	if (n_bomap_pages) {
+0 −1
Original line number Diff line number Diff line
@@ -97,7 +97,6 @@ struct etnaviv_gem_submit {
	struct list_head node; /* GPU active submit list */
	struct etnaviv_cmdbuf cmdbuf;
	struct pid *pid;       /* submitting process */
	bool runtime_resumed;
	u32 exec_state;
	u32 flags;
	unsigned int nr_pmrs;
Loading