linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <VenkataRajesh.Kalakodima@in.bosch.com>
To: <linux-renesas-soc@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-clk@vger.kernel.org>,
	<dri-devel@lists.freedesktop.org>
Cc: kalakodima venkata rajesh <venkatarajesh.kalakodima@in.bosch.com>,
	Harsha M M <harsha.manjulamallikarjun@in.bosch.com>,
	Eugeniu Rosca <erosca@de.adit-jv.com>
Subject: [PATCH 3/8] drm: rcar-du: Give a name to clu table samples
Date: Wed, 3 Apr 2019 18:44:39 +0530	[thread overview]
Message-ID: <1554297284-14009-4-git-send-email-VenkataRajesh.Kalakodima@in.bosch.com> (raw)
In-Reply-To: <1554297284-14009-1-git-send-email-VenkataRajesh.Kalakodima@in.bosch.com>

From: kalakodima venkata rajesh <venkatarajesh.kalakodima@in.bosch.com>

Replace the hardcoded value of clu table sample count with a
meaningful name.

Signed-off-by: Harsha M M <harsha.manjulamallikarjun@in.bosch.com>

This is the out-of-tree patch for DU CMM driver support from
    Yocto release v3.6.0. The part of this patch adding CMM support to
    the new Rcar E3 (R8A77990) SoC was filtered out due to lack of
    Yocto v3.6.0 (i.e. rcar-3.6.2) kernel updates on staging-414.

    Link: https://github.com/renesas-rcar/du_cmm/commit/53973b806881ed8f54500b0d42bdc40aaca60476.patch

    Following is from the patch description:

    Subject: [PATCH] du_cmm: Release for Yocto v3.6.0

    This patch made the following correspondence.

      - R-Car E3(R8A77990) device support.
      - Fix rewritting of parameter procedure in rcar_du_cmm_postclose

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>

      - Resolved checkpatch errors
      - Resolved merge conflicts according to latest version

Signed-off-by: kalakodima venkata rajesh <venkatarajesh.kalakodima@in.bosch.com>
---
 drivers/gpu/drm/rcar-du/rcar_du_cmm.c | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_cmm.c b/drivers/gpu/drm/rcar-du/rcar_du_cmm.c
index ac613a6e..d380dd9 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_cmm.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_cmm.c
@@ -75,9 +75,9 @@
 #include <linux/clk.h>
 
 /* #define DEBUG_PROCE_TIME 1 */
-
+#define CMM_CLU_SAMPLES 17
 #define CMM_LUT_NUM 256
-#define CMM_CLU_NUM (17 * 17 * 17)
+#define CMM_CLU_NUM (CMM_CLU_SAMPLES * CMM_CLU_SAMPLES * CMM_CLU_SAMPLES)
 #define CMM_HGO_NUM 64
 /* rcar_du_drm.h Include */
 #define LUT_DOUBLE_BUFFER_AUTO		0
@@ -211,11 +211,11 @@ static inline u32 index_to_clu_data(int index)
 {
 	int r, g, b;
 
-	r = index % 17;
-	index /= 17;
-	g = index % 17;
-	index /= 17;
-	b = index % 17;
+	r = index % CMM_CLU_SAMPLES;
+	index /= CMM_CLU_SAMPLES;
+	g = index % CMM_CLU_SAMPLES;
+	index /= CMM_CLU_SAMPLES;
+	b = index % CMM_CLU_SAMPLES;
 
 	r = (r << 20);
 	if (r > (255 << 16))
@@ -630,9 +630,9 @@ static int clu_table_copy(struct rcar_du_cmm *du_cmm)
 	}
 
 	rcar_du_cmm_write(du_cmm, dst_addr, 0);
-	for (i = 0; i < 17; i++) {
-		for (j = 0; j < 17; j++) {
-			for (k = 0; k < 17; k++) {
+	for (i = 0; i < CMM_CLU_SAMPLES; i++) {
+		for (j = 0; j < CMM_CLU_SAMPLES; j++) {
+			for (k = 0; k < CMM_CLU_SAMPLES; k++) {
 				rcar_du_cmm_write(du_cmm, src_addr,
 						  (k << 16) | (j << 8) |
 						  (i << 0));
@@ -912,9 +912,9 @@ int rcar_du_cmm_pm_suspend(struct rcar_du_crtc *rcrtc)
 	}
 
 	index = 0;
-	for (i = 0; i < 17; i++) {
-		for (j = 0; j < 17; j++) {
-			for (k = 0; k < 17; k++) {
+	for (i = 0; i < CMM_CLU_SAMPLES; i++) {
+		for (j = 0; j < CMM_CLU_SAMPLES; j++) {
+			for (k = 0; k < CMM_CLU_SAMPLES; k++) {
 				rcar_du_cmm_write(du_cmm, CMM_CLU_ADDR,
 						  (k << 16) | (j << 8) |
 						  (i << 0));
@@ -1014,6 +1014,8 @@ void rcar_du_cmm_postclose(struct drm_device *dev, struct drm_file *file_priv)
 	for (crtcs_cnt = 0; crtcs_cnt < rcdu->num_crtcs; crtcs_cnt++) {
 		rcrtc = &rcdu->crtcs[crtcs_cnt];
 		du_cmm = rcrtc->cmm_handle;
+		if (!du_cmm)
+			continue;
 		if (du_cmm->authority && du_cmm->pid == task_pid_nr(current)) {
 			du_cmm->authority = false;
 			du_cmm->pid = 0;
-- 
2.7.4


  parent reply	other threads:[~2019-04-03 13:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03 13:14 [PATCH 0/8] v4.19.0 Added Color Management Module VenkataRajesh.Kalakodima
2019-04-03 13:14 ` [PATCH 1/8] drm: Add DU CMM support functions VenkataRajesh.Kalakodima
2019-04-04 10:09   ` Laurent Pinchart
2019-04-03 13:14 ` [PATCH 2/8] drm: Add DU CMM support boot and clk changes VenkataRajesh.Kalakodima
2019-04-04 10:12   ` Laurent Pinchart
2019-04-03 13:14 ` VenkataRajesh.Kalakodima [this message]
2019-04-04 10:15   ` [PATCH 3/8] drm: rcar-du: Give a name to clu table samples Laurent Pinchart
2019-04-03 13:14 ` [PATCH 4/8] drm: rcar-du: Refactor the code with new functions VenkataRajesh.Kalakodima
2019-04-03 13:14 ` [PATCH 5/8] drm: rcar-du: Implement interfaces to set clu and lut using drm data structures VenkataRajesh.Kalakodima
2019-04-04  7:50   ` Daniel Vetter
2019-04-04 15:40     ` Ville Syrjälä
2019-04-05  8:39       ` Harsha Manjula Mallikarjun (RBEI/ECF3)
2019-04-03 13:14 ` [PATCH 6/8] drm: rcar-du: Implement atomic_check to check for gamma and ctm properties VenkataRajesh.Kalakodima
2019-04-03 13:14 ` [PATCH 7/8] drm: rcar-du: update gamma and ctm properties in commit tail VenkataRajesh.Kalakodima
2019-04-04 10:19   ` Laurent Pinchart
2019-04-03 13:14 ` [PATCH 8/8] drm: rcar-du: Add shutdown callback function in platform_driver VenkataRajesh.Kalakodima
2019-04-04  7:47   ` Daniel Vetter
2019-04-04 10:26   ` Laurent Pinchart
2019-04-04  9:45 ` [PATCH 0/8] v4.19.0 Added Color Management Module Laurent Pinchart
2019-04-04  9:46   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1554297284-14009-4-git-send-email-VenkataRajesh.Kalakodima@in.bosch.com \
    --to=venkatarajesh.kalakodima@in.bosch.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=erosca@de.adit-jv.com \
    --cc=harsha.manjulamallikarjun@in.bosch.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).