Skip to contentSkip to conversation

drm/exynos: fimd: calculate the correct address offset

PATCH Superseded Leela Krishna Amudala 2 participants 5 messages Mar 5, 2013 – Mar 6, 2013

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/exynos: fimd: calculate the correct address offset

Calculate the correct address offset values for alpha and color key control registers

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +5 -4
index 9537761..71f4176 100644
@@ -41,7 +41,7 @@
 /* size control register for hardware window 0. */
 #define VIDOSD_C_SIZE_W0	(VIDOSD_BASE + 0x08)
 /* alpha control register for hardware window 1 ~ 4. */
-#define VIDOSD_C(win)		(VIDOSD_BASE + 0x18 + (win) * 16)
+#define VIDOSD_C(win)		(VIDOSD_BASE + 0x08 + (win) * 16)
 /* size control register for hardware window 1 ~ 4. */
 #define VIDOSD_D(win)		(VIDOSD_BASE + 0x0C + (win) * 16)
 
@@ -50,9 +50,9 @@
 #define VIDWx_BUF_SIZE(win, buf)	(VIDW_BUF_SIZE(buf) + (win) * 4)
 
 /* color key control register for hardware window 1 ~ 4. */
-#define WKEYCON0_BASE(x)		((WKEYCON0 + 0x140) + (x * 8))
+#define WKEYCON0_BASE(x)		((WKEYCON0 + 0x140) + ((x - 1) * 8))
 /* color key value register for hardware window 1 ~ 4. */
-#define WKEYCON1_BASE(x)		((WKEYCON1 + 0x140) + (x * 8))
+#define WKEYCON1_BASE(x)		((WKEYCON1 + 0x140) + ((x - 1) * 8))
 
 /* FIMD has totally five hardware windows. */
 #define WINDOWS_NR	5
@@ -782,7 +782,8 @@ static void fimd_clear_win(struct fimd_context *ctx, int win)
 	writel(0, ctx->regs + WINCON(win));
 	writel(0, ctx->regs + VIDOSD_A(win));
 	writel(0, ctx->regs + VIDOSD_B(win));
-	writel(0, ctx->regs + VIDOSD_C(win));
+	if (win != 0)
+		writel(0, ctx->regs + VIDOSD_C(win));
 
 	if (win == 1 || win == 2)
 		writel(0, ctx->regs + VIDOSD_D(win));
Signature · 1 line
1.8.0
#1 lore raw

Hi Leela,

Quoted 13 lines · Leela Krishna Amudala

Calculate the correct address offset values for alpha and color key control registers

---
  drivers/gpu/drm/exynos/exynos_drm_fimd.c | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -0
index 9537761..71f4176 100644

drivers/gpu/drm/exynos/exynos_drm_fimd.c line 42

Quoted 2 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -0
@@ -41,7 +41,7 @@
  /* size control register for hardware window 0. */
  #define VIDOSD_C_SIZE_W0	(VIDOSD_BASE + 0x08)

How about just use VIDOSD_C(win) instead of this macro for size control register of windows0? I think it's better if writes comments properly here.

Quoted 19 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +3 -3
  /* alpha control register for hardware window 1 ~ 4. */
-#define VIDOSD_C(win)		(VIDOSD_BASE + 0x18 + (win) * 16)
+#define VIDOSD_C(win)		(VIDOSD_BASE + 0x08 + (win) * 16)
  /* size control register for hardware window 1 ~ 4. */
  #define VIDOSD_D(win)		(VIDOSD_BASE + 0x0C + (win) * 16)
 
@@ -50,9 +50,9 @@
  #define VIDWx_BUF_SIZE(win, buf)	(VIDW_BUF_SIZE(buf) + (win) * 4)
 
  /* color key control register for hardware window 1 ~ 4. */
-#define WKEYCON0_BASE(x)		((WKEYCON0 + 0x140) + (x * 8))
+#define WKEYCON0_BASE(x)		((WKEYCON0 + 0x140) + ((x - 1) * 8))
  /* color key value register for hardware window 1 ~ 4. */
-#define WKEYCON1_BASE(x)		((WKEYCON1 + 0x140) + (x * 8))
+#define WKEYCON1_BASE(x)		((WKEYCON1 + 0x140) + ((x - 1) * 8))
 
  /* FIMD has totally five hardware windows. */
  #define WINDOWS_NR	5

drivers/gpu/drm/exynos/exynos_drm_fimd.c static void fimd_clear_win(struct fimd_context *ctx, int win) · line 786

Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -1
@@ -782,7 +782,8 @@ static void fimd_clear_win(struct fimd_context *ctx, int win)
  	writel(0, ctx->regs + WINCON(win));
  	writel(0, ctx->regs + VIDOSD_A(win));
  	writel(0, ctx->regs + VIDOSD_B(win));
-	writel(0, ctx->regs + VIDOSD_C(win));
+	if (win != 0)
+		writel(0, ctx->regs + VIDOSD_C(win));

If use VIDOSD_C(win) macro for size control register of windows0 then this fix will be unnecessary.

Thanks.

#2 lore raw

Hi,

Quoted 13 lines · Joonyoung Shim

Hi Leela,

Quoted 9 lines · Leela Krishna Amudala

Calculate the correct address offset values for alpha and color key control registers

---
  drivers/gpu/drm/exynos/exynos_drm_fimd.c | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)
Quoted 14 lines

drivers/gpu/drm/exynos/exynos_drm_fimd.c line 42

Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -0
index 9537761..71f4176 100644
@@ -41,7 +41,7 @@
  /* size control register for hardware window 0. */
  #define VIDOSD_C_SIZE_W0      (VIDOSD_BASE + 0x08)

How about just use VIDOSD_C(win) instead of this macro for size control register of windows0?
I think it's better if writes comments properly here.

Then in that case
VIDOSD_C(0) will refer to Window 0 Size Control register VIDOSD_C(1) will refer to Window 1 Alpha Control register VIDOSD_C(2) will refer to Window 2 Alpha Control register VIDOSD_C(3) will refer to Window 3 Alpha Control register VIDOSD_C(4) will refer to Window 4 Alpha Control register Which leads to a confusion.

IMHO keeping VIDOSD_C_SIZE_W0 separate for win 0 is good.

Best Wishes,
Leela Krishna Amudala

Quoted 37 lines
Quoted 19 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -1
  /* alpha control register for hardware window 1 ~ 4. */
-#define VIDOSD_C(win)          (VIDOSD_BASE + 0x18 + (win) * 16)
+#define VIDOSD_C(win)          (VIDOSD_BASE + 0x08 + (win) * 16)
  /* size control register for hardware window 1 ~ 4. */
  #define VIDOSD_D(win)         (VIDOSD_BASE + 0x0C + (win) * 16)
  @@ -50,9 +50,9 @@
  #define VIDWx_BUF_SIZE(win, buf)      (VIDW_BUF_SIZE(buf) + (win) * 4)
    /* color key control register for hardware window 1 ~ 4. */
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -1
-#define WKEYCON0_BASE(x)               ((WKEYCON0 + 0x140) + (x * 8))
+#define WKEYCON0_BASE(x)               ((WKEYCON0 + 0x140) + ((x - 1) *

8))
/* color key value register for hardware window 1 ~ 4. */

drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -1
-#define WKEYCON1_BASE(x)               ((WKEYCON1 + 0x140) + (x * 8))
+#define WKEYCON1_BASE(x)               ((WKEYCON1 + 0x140) + ((x - 1) *

8))

    /* FIMD has totally five hardware windows. */

#define WINDOWS_NR 5

drivers/gpu/drm/exynos/exynos_drm_fimd.c static void fimd_clear_win(struct fimd_context *ctx, · line 787

Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -1
@@ -782,7 +782,8 @@ static void fimd_clear_win(struct fimd_context *ctx,
 int win)
        writel(0, ctx->regs + WINCON(win));
        writel(0, ctx->regs + VIDOSD_A(win));
        writel(0, ctx->regs + VIDOSD_B(win));
-       writel(0, ctx->regs + VIDOSD_C(win));
+       if (win != 0)
+               writel(0, ctx->regs + VIDOSD_C(win));

If use VIDOSD_C(win) macro for size control register of windows0 then this fix will be unnecessary.

Thanks.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 28 lines · Leela Krishna Amudala

Hi,

Quoted 12 lines · Joonyoung Shim

Hi Leela,

Quoted 8 lines · Leela Krishna Amudala

Calculate the correct address offset values for alpha and color key control registers

---
   drivers/gpu/drm/exynos/exynos_drm_fimd.c | 9 +++++----
   1 file changed, 5 insertions(+), 4 deletions(-)
Quoted 13 lines

drivers/gpu/drm/exynos/exynos_drm_fimd.c line 42

Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -0
index 9537761..71f4176 100644
@@ -41,7 +41,7 @@
   /* size control register for hardware window 0. */
   #define VIDOSD_C_SIZE_W0      (VIDOSD_BASE + 0x08)

How about just use VIDOSD_C(win) instead of this macro for size control register of windows0?
I think it's better if writes comments properly here.

Quoted 7 lines

Then in that case
VIDOSD_C(0) will refer to Window 0 Size Control register VIDOSD_C(1) will refer to Window 1 Alpha Control register VIDOSD_C(2) will refer to Window 2 Alpha Control register VIDOSD_C(3) will refer to Window 3 Alpha Control register VIDOSD_C(4) will refer to Window 4 Alpha Control register Which leads to a confusion.

Because of confusion, we need correct comments.

Quoted 22 lines

IMHO keeping VIDOSD_C_SIZE_W0 separate for win 0 is good.

Best Wishes,
Leela Krishna Amudala

Quoted 17 lines
Quoted 17 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -1
   /* alpha control register for hardware window 1 ~ 4. */
-#define VIDOSD_C(win)          (VIDOSD_BASE + 0x18 + (win) * 16)
+#define VIDOSD_C(win)          (VIDOSD_BASE + 0x08 + (win) * 16)
   /* size control register for hardware window 1 ~ 4. */
   #define VIDOSD_D(win)         (VIDOSD_BASE + 0x0C + (win) * 16)
   @@ -50,9 +50,9 @@
   #define VIDWx_BUF_SIZE(win, buf)      (VIDW_BUF_SIZE(buf) + (win) * 4)
     /* color key control register for hardware window 1 ~ 4. */
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -1
-#define WKEYCON0_BASE(x)               ((WKEYCON0 + 0x140) + (x * 8))
+#define WKEYCON0_BASE(x)               ((WKEYCON0 + 0x140) + ((x - 1) *

8))
/* color key value register for hardware window 1 ~ 4. */

drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -1
-#define WKEYCON1_BASE(x)               ((WKEYCON1 + 0x140) + (x * 8))
+#define WKEYCON1_BASE(x)               ((WKEYCON1 + 0x140) + ((x - 1) *

8))

     /* FIMD has totally five hardware windows. */

#define WINDOWS_NR 5

Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/exynos/exynos_drm_fimd.c static void fimd_clear_win(struct fimd_context *ctx, · line 787

Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -1
@@ -782,7 +782,8 @@ static void fimd_clear_win(struct fimd_context *ctx,
 int win)
         writel(0, ctx->regs + WINCON(win));
         writel(0, ctx->regs + VIDOSD_A(win));
         writel(0, ctx->regs + VIDOSD_B(win));
-       writel(0, ctx->regs + VIDOSD_C(win));
+       if (win != 0)
+               writel(0, ctx->regs + VIDOSD_C(win));

Then you need also to initialize VIDOSD_C_SIZE_W0 register.

Quoted 10 lines
Quoted 10 lines

If use VIDOSD_C(win) macro for size control register of windows0 then this fix will be unnecessary.

Thanks.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

Hi

Quoted 43 lines · Joonyoung Shim
Quoted 33 lines · Leela Krishna Amudala

Hi,

Quoted 14 lines · Joonyoung Shim

Hi Leela,

Quoted 9 lines · Leela Krishna Amudala

Calculate the correct address offset values for alpha and color key control registers

---
   drivers/gpu/drm/exynos/exynos_drm_fimd.c | 9 +++++----
   1 file changed, 5 insertions(+), 4 deletions(-)
Quoted 14 lines

drivers/gpu/drm/exynos/exynos_drm_fimd.c line 42

Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -0
index 9537761..71f4176 100644
@@ -41,7 +41,7 @@
   /* size control register for hardware window 0. */
   #define VIDOSD_C_SIZE_W0      (VIDOSD_BASE + 0x08)

How about just use VIDOSD_C(win) instead of this macro for size control register of windows0?
I think it's better if writes comments properly here.

Quoted 7 lines

Then in that case
VIDOSD_C(0) will refer to Window 0 Size Control register VIDOSD_C(1) will refer to Window 1 Alpha Control register VIDOSD_C(2) will refer to Window 2 Alpha Control register VIDOSD_C(3) will refer to Window 3 Alpha Control register VIDOSD_C(4) will refer to Window 4 Alpha Control register Which leads to a confusion.

Quoted 2 lines

Because of confusion, we need correct comments.

Added appropriate comments and posted V2

Quoted 27 lines
Quoted 27 lines

IMHO keeping VIDOSD_C_SIZE_W0 separate for win 0 is good.

Best Wishes,
Leela Krishna Amudala

Quoted 21 lines
Quoted 21 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -1
   /* alpha control register for hardware window 1 ~ 4. */
-#define VIDOSD_C(win)          (VIDOSD_BASE + 0x18 + (win) * 16)
+#define VIDOSD_C(win)          (VIDOSD_BASE + 0x08 + (win) * 16)
   /* size control register for hardware window 1 ~ 4. */
   #define VIDOSD_D(win)         (VIDOSD_BASE + 0x0C + (win) * 16)
   @@ -50,9 +50,9 @@
   #define VIDWx_BUF_SIZE(win, buf)      (VIDW_BUF_SIZE(buf) + (win) *
4)
     /* color key control register for hardware window 1 ~ 4. */
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -1
-#define WKEYCON0_BASE(x)               ((WKEYCON0 + 0x140) + (x * 8))
+#define WKEYCON0_BASE(x)               ((WKEYCON0 + 0x140) + ((x - 1) *

8))
/* color key value register for hardware window 1 ~ 4. */

drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -1
-#define WKEYCON1_BASE(x)               ((WKEYCON1 + 0x140) + (x * 8))
+#define WKEYCON1_BASE(x)               ((WKEYCON1 + 0x140) + ((x - 1) *

8))

     /* FIMD has totally five hardware windows. */

#define WINDOWS_NR 5

drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -0
@@ -782,7 +782,8 @@ static void fimd_clear_win(struct fimd_context *ctx,
 int win)
         writel(0, ctx->regs + WINCON(win));
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines

drivers/gpu/drm/exynos/exynos_drm_fimd.c static void fimd_clear_win(struct fimd_context *ctx, int win) · line 786

Quoted 5 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -1
         writel(0, ctx->regs + VIDOSD_A(win));
         writel(0, ctx->regs + VIDOSD_B(win));
-       writel(0, ctx->regs + VIDOSD_C(win));
+       if (win != 0)
+               writel(0, ctx->regs + VIDOSD_C(win));

Then you need also to initialize VIDOSD_C_SIZE_W0 register.

Initialized and posted V2

Best Wishes,
Leela Krishna Amudala.

Quoted 18 lines
Quoted 6 lines
Quoted 6 lines

If use VIDOSD_C(win) macro for size control register of windows0 then this
fix will be unnecessary.

Quoted 6 lines
Quoted 6 lines

Thanks.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel