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

Commit b531ffe5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: dts: msm: Add qcom,gpu-limit property for sdm660"

parents cbbefa3a 15427a54
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -6,10 +6,14 @@ Required properties:
- reg : offset and length of msm camera device registers.
- reg-names : should specify relevant names for each reg property defined.

Optional properties:
- qcom,gpu-limit : valid kgsl frequency.

Example:

   qcom,msm-cam@fd8c0000 {
       compatible = "qcom,msm-cam";
       reg = <0xfd8C0000 0x10000>;
       reg-names = "msm-cam";
       qcom,gpu-limit = <700000000>;
   };
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
		status = "ok";
		bus-vectors = "suspend", "svs", "nominal", "turbo";
		qcom,bus-votes = <0 150000000 320000000 320000000>;
		qcom,gpu-limit = <700000000>;
	};

	qcom,csiphy@c824000 {
+19 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-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
@@ -53,6 +53,8 @@ spinlock_t msm_eventq_lock;
static struct pid *msm_pid;
spinlock_t msm_pid_lock;

static uint32_t gpu_limit;

/*
 * It takes 20 bytes + NULL character to write the
 * largest decimal value of an uint64_t
@@ -442,6 +444,14 @@ int msm_create_session(unsigned int session_id, struct video_device *vdev)
	mutex_init(&session->lock);
	mutex_init(&session->lock_q);
	mutex_init(&session->close_lock);

	if (gpu_limit) {
		session->sysfs_pwr_limit = kgsl_pwr_limits_add(KGSL_DEVICE_3D0);
		if (session->sysfs_pwr_limit)
			kgsl_pwr_limits_set_freq(session->sysfs_pwr_limit,
				gpu_limit);
	}

	return 0;
}
EXPORT_SYMBOL(msm_create_session);
@@ -607,6 +617,11 @@ int msm_destroy_session(unsigned int session_id)
	if (!session)
		return -EINVAL;

	if (gpu_limit && session->sysfs_pwr_limit) {
		kgsl_pwr_limits_set_default(session->sysfs_pwr_limit);
		kgsl_pwr_limits_del(session->sysfs_pwr_limit);
	}

	msm_destroy_session_streams(session);
	msm_remove_session_cmd_ack_q(session);
	mutex_destroy(&session->lock);
@@ -1290,6 +1305,9 @@ static int msm_probe(struct platform_device *pdev)
		goto v4l2_fail;
	}

	of_property_read_u32(pdev->dev.of_node,
		"qcom,gpu-limit", &gpu_limit);

	goto probe_end;

v4l2_fail:
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-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
@@ -20,6 +20,7 @@
#include <linux/pm_qos.h>
#include <linux/msm_ion.h>
#include <linux/iommu.h>
#include <linux/msm_kgsl.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-device.h>
@@ -110,6 +111,7 @@ struct msm_session {
	struct mutex lock;
	struct mutex lock_q;
	struct mutex close_lock;
	struct kgsl_pwr_limit *sysfs_pwr_limit;
};

static inline bool msm_is_daemon_present(void)