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

Commit dff13e51 authored by Ramakant Singh's avatar Ramakant Singh Committed by Ian Maund
Browse files

msm: mdss: sysfs node to disable smart blit



Add "smart_blit" node in sysfs to enable or disable blit
optimization through adb shell.
"echo 0 > smart_blit" disable smart blit
"echo 1 > smart_blit" enable smart blit

Change-Id: Iae8b46f3ac656ca8f38dbf9f01992e77caf7452d
Signed-off-by: default avatarRamakant Singh <ramaka@codeaurora.org>
parent d4fedca0
Loading
Loading
Loading
Loading
+32 −1
Original line number Diff line number Diff line
@@ -924,7 +924,7 @@ static int mdp3_hw_init(void)
	}
	mdp3_res->intf[MDP3_DMA_OUTPUT_SEL_AHB].available = 0;
	mdp3_res->intf[MDP3_DMA_OUTPUT_SEL_LCDC].available = 0;

	mdp3_res->smart_blit_en = true;
	return 0;
}

@@ -2246,8 +2246,39 @@ static ssize_t mdp3_show_capabilities(struct device *dev,

static DEVICE_ATTR(caps, S_IRUGO, mdp3_show_capabilities, NULL);

static ssize_t mdp3_store_smart_blit(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t len)
{
	u32 data = -1;
	int rc = 0;
	rc = kstrtoint(buf, 10, &data);
	if (rc) {
		pr_err("kstrtoint failed. rc=%d\n", rc);
		return rc;
	} else {
		mdp3_res->smart_blit_en = data ? true : false;
		pr_debug("mdp3 smart blit %s\n",
			 mdp3_res->smart_blit_en ? "ENABLED" : "DISABLED");
	}
	return len;
}

static ssize_t mdp3_show_smart_blit(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	ssize_t ret = 0;
	pr_debug("mdp3 smart blit %s\n",
		mdp3_res->smart_blit_en ? "ENABLED" : "DISABLED");
	ret = snprintf(buf, PAGE_SIZE, "%d\n", mdp3_res->smart_blit_en);
	return ret;
}

static DEVICE_ATTR(smart_blit, S_IRUGO | S_IWUSR | S_IWGRP, mdp3_show_smart_blit,
                                        mdp3_store_smart_blit);

static struct attribute *mdp3_fs_attrs[] = {
	&dev_attr_caps.attr,
	&dev_attr_smart_blit.attr,
	NULL
};

+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 * Copyright (C) 2007 Google Incorporated
 *
 * This program is free software; you can redistribute it and/or modify
@@ -180,6 +180,7 @@ struct mdp3_hw_resource {
	struct regulator *vdd_cx;
	struct regulator *fs;
	bool fs_ena;
	bool smart_blit_en;
};

struct mdp3_img_data {
+5 −0
Original line number Diff line number Diff line
@@ -465,6 +465,7 @@ int mdp3_calc_ppp_res(struct msm_fb_data_type *mfd, struct blit_req_list *lreq)
	u32 fps = 0;
	int smart_blit_fg_indx = -1;
	u32 smart_blit_bg_read_bw = 0;

	ATRACE_BEGIN(__func__);
	lcount = lreq->count;
	if (lcount == 0) {
@@ -1232,6 +1233,10 @@ static bool is_blit_optimization_possible(struct blit_req_list *req, int indx)
	int next = indx + 1;
	bool status = false;

	if (!(mdp3_res->smart_blit_en)) {
		pr_debug("Smart BLIT disabled from sysfs\n");
		return status;
	}
	if (next < req->count) {
		/*
		 * Check userspace Smart BLIT Flag for current and next request