RK3368 GPU: Update to Rogue 5.13.

Add gpu performance interface for cts.

Change-Id: I6d0259e97b4fe140eb1e63196e1008adf4a33c66
Signed-off-by: ZhuangXiaoLiang <zhuangxl@rock-chips.com>
This commit is contained in:
ZhuangXiaoLiang
2017-11-06 21:20:41 +08:00
committed by Tao Huang
parent 957e542486
commit e911ee2e34
4 changed files with 36 additions and 1 deletions

View File

@@ -214,6 +214,33 @@ static long pvr_compat_ioctl(struct file *file, unsigned int cmd,
}
#endif /* defined(CONFIG_COMPAT) */
int g_gpu_performance = -1;
static ssize_t PVRSRV_Perf_Write(struct file *pfile, const char __user *ubuf,
size_t count, loff_t *ploff)
{
char kbuf[10];
long enable = -1;
if (count > sizeof(kbuf))
count = sizeof(kbuf);
if (copy_from_user(kbuf, ubuf, count)) {
DRM_ERROR("%s: copy_to_user failed!\n", __func__);
return -EFAULT;
}
kbuf[count - 1] = '\0';
if (kstrtol(kbuf, 10, &enable) != 0) {
DRM_ERROR("%s: kstrtol failed!\n", __func__);
return -EFAULT;
}
if (g_gpu_performance != enable)
g_gpu_performance = enable;
return count;
}
static const struct file_operations pvr_drm_fops = {
.owner = THIS_MODULE,
.open = drm_open,
@@ -231,6 +258,7 @@ static const struct file_operations pvr_drm_fops = {
.mmap = PVRSRV_MMap,
.poll = drm_poll,
.read = drm_read,
.write = PVRSRV_Perf_Write,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0))
.fasync = drm_fasync,
#endif

View File

@@ -128,6 +128,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* N 5.12
* 1. Fix PVRSRVDevicePreClockSpeedChange failed.
* 2. Apply PP_fix_KM patch from IMG.
* N 5.13
* Add gpu performance interface for cts.
*/
#define PVR_STR(X) #X
@@ -155,5 +157,5 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define PVRVERSION_UNPACK_MIN(VERSION) (((VERSION) >> 0) & 0xFFFF)
//chenli:define rockchip version
#define RKVERSION "Rogue N 5.12"
#define RKVERSION "Rogue N 5.13"
#endif /* _PVRVERSION_H_ */

View File

@@ -100,6 +100,9 @@ static IMG_INT32 devfreq_target(struct device *dev, long unsigned *requested_fre
return 0;
}
if (g_gpu_performance == 1)
*requested_freq = psDVFSDevice->psDevFreq->max_freq;
rcu_read_lock();
opp = devfreq_recommended_opp(dev, requested_freq, flags);
if (IS_ERR(opp)) {

View File

@@ -48,6 +48,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "pvrsrv_error.h"
#include "img_types.h"
extern int g_gpu_performance;
PVRSRV_ERROR InitDVFS(PVRSRV_DEVICE_NODE *psDeviceNode);
void DeinitDVFS(PVRSRV_DEVICE_NODE *psDeviceNode);