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

Commit 50d1e7a1 authored by Steve Cohen's avatar Steve Cohen
Browse files

drm/msm: update msm gem and smmu for 4.14



This patch fixes some errors when merging downstream 4.9 code with
upstream 4.14 code and addresses issues with holding the global
struct_mutex locks as well as the increase in size of iova variables
from 32-bit to 64-bit values.  Some functions in msm_gem_vma.c were
moved around to improve readability.

Change-Id: I672147376b4c6bead1d775dbbbb4d31b48ac65f4
Signed-off-by: default avatarSteve Cohen <cohens@codeaurora.org>
parent e444d282
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -183,6 +183,7 @@ msm_drm-$(CONFIG_DRM_MSM) += \
	msm_gem_prime.o \
	msm_gem_submit.o \
	msm_gem_shrinker.o \
	msm_gem_vma.o\
	msm_gpu.o \
	msm_iommu.o \
	msm_smmu.o \
+1 −1
Original line number Diff line number Diff line
@@ -1390,7 +1390,7 @@ static int dsi_ctrl_buffer_deinit(struct dsi_ctrl *dsi_ctrl)
int dsi_ctrl_buffer_init(struct dsi_ctrl *dsi_ctrl)
{
	int rc = 0;
	u32 iova = 0;
	u64 iova = 0;
	struct msm_gem_address_space *aspace = NULL;

	aspace = dsi_ctrl_get_aspace(dsi_ctrl, MSM_SMMU_DOMAIN_UNSECURE);
+4 −6
Original line number Diff line number Diff line
@@ -1947,11 +1947,11 @@ static void dsi_display_aspace_cb_locked(void *cb_data, bool is_detach)
		display->cmd_buffer_iova = 0;

		/* return the virtual address mapping */
		msm_gem_put_vaddr_locked(display->tx_cmd_buf);
		msm_gem_vunmap(display->tx_cmd_buf);
		msm_gem_put_vaddr(display->tx_cmd_buf);
		msm_gem_vunmap(display->tx_cmd_buf, OBJ_LOCK_NORMAL);

	} else {
		rc = msm_gem_get_iova_locked(display->tx_cmd_buf,
		rc = msm_gem_get_iova(display->tx_cmd_buf,
				display->aspace, &(display->cmd_buffer_iova));
		if (rc) {
			pr_err("failed to get the iova rc %d\n", rc);
@@ -1959,7 +1959,7 @@ static void dsi_display_aspace_cb_locked(void *cb_data, bool is_detach)
		}

		display->vaddr =
			(void *) msm_gem_get_vaddr_locked(display->tx_cmd_buf);
			(void *) msm_gem_get_vaddr(display->tx_cmd_buf);

		if (IS_ERR_OR_NULL(display->vaddr)) {
			pr_err("failed to get va rc %d\n", rc);
@@ -2026,11 +2026,9 @@ static ssize_t dsi_host_transfer(struct mipi_dsi_host *host,
	}

	if (display->tx_cmd_buf == NULL) {
		mutex_lock(&display->drm_dev->struct_mutex);
		display->tx_cmd_buf = msm_gem_new(display->drm_dev,
				SZ_4K,
				MSM_BO_UNCACHED);
		mutex_unlock(&display->drm_dev->struct_mutex);

		display->cmd_buffer_size = SZ_4K;

+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ struct dsi_display {
	bool phy_idle_power_off;
	struct drm_gem_object *tx_cmd_buf;
	u32 cmd_buffer_size;
	u32 cmd_buffer_iova;
	u64 cmd_buffer_iova;
	void *vaddr;
	struct msm_gem_address_space *aspace;

+1 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2017, 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
@@ -994,7 +994,6 @@ static int dsi_tx_buf_alloc(struct msm_dsi_host *msm_host, int size)

		ret = msm_gem_get_iova(msm_host->tx_gem_obj,
				priv->kms->aspace, &iova);
		mutex_unlock(&dev->struct_mutex);
		if (ret) {
			pr_err("%s: failed to get iova, %d\n", __func__, ret);
			return ret;
Loading