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

Commit 0bea8c91 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

drm/msm: Remove iommu names during attach



None of the existing iommu implementations use the names passed in
at attach time by the API. Save a bit of .data room by removing
the static string definitions and passing NULL to the attach function.

Change-Id: Ic0dedbada9561768b8d9716ea101619e6b549ea4
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent f0eb0ed5
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -404,10 +404,6 @@ void adreno_wait_ring(struct msm_ringbuffer *ring, uint32_t ndwords)
			ring->gpu->name, ring->id);
}

static const char *iommu_ports[] = {
		"gfx3d_user",
};

/* Read the set of powerlevels */
static int _adreno_get_pwrlevels(struct msm_gpu *gpu, struct device_node *node)
{
@@ -579,8 +575,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,

	mmu = gpu->aspace->mmu;
	if (mmu) {
		ret = mmu->funcs->attach(mmu, iommu_ports,
				ARRAY_SIZE(iommu_ports));
		ret = mmu->funcs->attach(mmu, NULL, 0);
		if (ret)
			return ret;
	}
+3 −10
Original line number Diff line number Diff line
@@ -184,8 +184,7 @@ static void mdp4_preclose(struct msm_kms *kms, struct drm_file *file)
		mdp4_crtc_cancel_pending_flip(priv->crtcs[i], file);

	if (aspace) {
		aspace->mmu->funcs->detach(aspace->mmu,
				iommu_ports, ARRAY_SIZE(iommu_ports));
		aspace->mmu->funcs->detach(aspace->mmu);
		msm_gem_address_space_destroy(aspace);
	}
}
@@ -202,8 +201,7 @@ static void mdp4_destroy(struct msm_kms *kms)
		drm_gem_object_unreference_unlocked(mdp4_kms->blank_cursor_bo);

	if (aspace) {
		aspace->mmu->funcs->detach(aspace->mmu,
				iommu_ports, ARRAY_SIZE(iommu_ports));
		aspace->mmu->funcs->detach(aspace->mmu);
		msm_gem_address_space_put(aspace);
	}

@@ -416,10 +414,6 @@ fail:
	return ret;
}

static const char *iommu_ports[] = {
		"mdp_port0_cb0", "mdp_port1_cb0",
};

struct msm_kms *mdp4_kms_init(struct drm_device *dev)
{
	struct platform_device *pdev = dev->platformdev;
@@ -527,8 +521,7 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev)

		mdp4_kms->aspace = aspace;

		ret = aspace->mmu->funcs->attach(aspace->mmu, iommu_ports,
				ARRAY_SIZE(iommu_ports));
		ret = aspace->mmu->funcs->attach(aspace->mmu, NULL, 0);
		if (ret)
			goto fail;
	} else {
+1 −6
Original line number Diff line number Diff line
@@ -22,10 +22,6 @@
#include "msm_mmu.h"
#include "mdp5_kms.h"

static const char *iommu_ports[] = {
		"mdp_0",
};

static int mdp5_hw_init(struct msm_kms *kms)
{
	struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms));
@@ -613,8 +609,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)

		mdp5_kms->aspace = aspace;

		ret = aspace->mmu->funcs->attach(aspace->mmu, iommu_ports,
				ARRAY_SIZE(iommu_ports));
		ret = aspace->mmu->funcs->attach(aspace->mmu, NULL, 0);
		if (ret) {
			dev_err(&pdev->dev, "failed to attach iommu: %d\n",
				ret);
+1 −6
Original line number Diff line number Diff line
@@ -41,10 +41,6 @@
#define CREATE_TRACE_POINTS
#include "sde_trace.h"

static const char * const iommu_ports[] = {
		"mdp_0",
};

/**
 * Controls size of event log buffer. Specified as a power of 2.
 */
@@ -1076,8 +1072,7 @@ static int _sde_kms_mmu_init(struct sde_kms *sde_kms)

		sde_kms->aspace[i] = aspace;

		ret = mmu->funcs->attach(mmu, (const char **)iommu_ports,
				ARRAY_SIZE(iommu_ports));
		ret = mmu->funcs->attach(mmu, NULL, 0);
		if (ret) {
			SDE_ERROR("failed to attach iommu %d: %d\n", i, ret);
			msm_gem_address_space_put(aspace);