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

Commit 23bd62fd authored by Aravind Ganesan's avatar Aravind Ganesan Committed by Rob Clark
Browse files

drm/msm: a4xx support for msm-drm



Added a4xx GPU support.

Signed-off-by: default avatarAravind Ganesan <aravindg@codeaurora.org>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent 91b74e97
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -7,6 +7,7 @@ msm-y := \
	adreno/adreno_device.o \
	adreno/adreno_device.o \
	adreno/adreno_gpu.o \
	adreno/adreno_gpu.o \
	adreno/a3xx_gpu.o \
	adreno/a3xx_gpu.o \
	adreno/a4xx_gpu.o \
	hdmi/hdmi.o \
	hdmi/hdmi.o \
	hdmi/hdmi_audio.o \
	hdmi/hdmi_audio.o \
	hdmi/hdmi_bridge.o \
	hdmi/hdmi_bridge.o \
+604 −0

File added.

Preview size limit exceeded, changes collapsed.

+34 −0
Original line number Original line Diff line number Diff line
/* Copyright (c) 2014 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */
#ifndef __A4XX_GPU_H__
#define __A4XX_GPU_H__

#include "adreno_gpu.h"

/* arrg, somehow fb.h is getting pulled in: */
#undef ROP_COPY
#undef ROP_XOR

#include "a4xx.xml.h"

struct a4xx_gpu {
	struct adreno_gpu base;
	struct platform_device *pdev;

	/* if OCMEM is used for GMEM: */
	uint32_t ocmem_base;
	void *ocmem_hdl;
};
#define to_a4xx_gpu(x) container_of(x, struct a4xx_gpu, base)

#endif /* __A4XX_GPU_H__ */
+13 −0
Original line number Original line Diff line number Diff line
@@ -2,6 +2,8 @@
 * Copyright (C) 2013-2014 Red Hat
 * Copyright (C) 2013-2014 Red Hat
 * Author: Rob Clark <robdclark@gmail.com>
 * Author: Rob Clark <robdclark@gmail.com>
 *
 *
 * Copyright (c) 2014 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 as published by
 * under the terms of the GNU General Public License version 2 as published by
 * the Free Software Foundation.
 * the Free Software Foundation.
@@ -28,6 +30,7 @@ MODULE_PARM_DESC(hang_debug, "Dump registers when hang is detected (can be slow!
module_param_named(hang_debug, hang_debug, bool, 0600);
module_param_named(hang_debug, hang_debug, bool, 0600);


struct msm_gpu *a3xx_gpu_init(struct drm_device *dev);
struct msm_gpu *a3xx_gpu_init(struct drm_device *dev);
struct msm_gpu *a4xx_gpu_init(struct drm_device *dev);


static const struct adreno_info gpulist[] = {
static const struct adreno_info gpulist[] = {
	{
	{
@@ -54,6 +57,14 @@ static const struct adreno_info gpulist[] = {
		.pfpfw = "a330_pfp.fw",
		.pfpfw = "a330_pfp.fw",
		.gmem  = SZ_1M,
		.gmem  = SZ_1M,
		.init  = a3xx_gpu_init,
		.init  = a3xx_gpu_init,
	}, {
		.rev   = ADRENO_REV(4, 2, 0, ANY_ID),
		.revn  = 420,
		.name  = "A420",
		.pm4fw = "a420_pm4.fw",
		.pfpfw = "a420_pfp.fw",
		.gmem  = (SZ_1M + SZ_512K),
		.init  = a4xx_gpu_init,
	},
	},
};
};


@@ -61,6 +72,8 @@ MODULE_FIRMWARE("a300_pm4.fw");
MODULE_FIRMWARE("a300_pfp.fw");
MODULE_FIRMWARE("a300_pfp.fw");
MODULE_FIRMWARE("a330_pm4.fw");
MODULE_FIRMWARE("a330_pm4.fw");
MODULE_FIRMWARE("a330_pfp.fw");
MODULE_FIRMWARE("a330_pfp.fw");
MODULE_FIRMWARE("a420_pm4.fw");
MODULE_FIRMWARE("a420_pfp.fw");


static inline bool _rev_match(uint8_t entry, uint8_t id)
static inline bool _rev_match(uint8_t entry, uint8_t id)
{
{
+1 −1
Original line number Original line Diff line number Diff line
@@ -155,7 +155,7 @@ int adreno_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
	OUT_PKT0(ring, REG_AXXX_CP_SCRATCH_REG2, 1);
	OUT_PKT0(ring, REG_AXXX_CP_SCRATCH_REG2, 1);
	OUT_RING(ring, submit->fence);
	OUT_RING(ring, submit->fence);


	if (adreno_is_a3xx(adreno_gpu)) {
	if (adreno_is_a3xx(adreno_gpu) || adreno_is_a4xx(adreno_gpu)) {
		/* Flush HLSQ lazy updates to make sure there is nothing
		/* Flush HLSQ lazy updates to make sure there is nothing
		 * pending for indirect loads after the timestamp has
		 * pending for indirect loads after the timestamp has
		 * passed:
		 * passed:
Loading