drm/exynos: fimd: calculate the correct address offset
Subsystems (3)
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
@@ -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
Hi Leela,
Quoted 13 lines · Leela Krishna Amudala
Calculate the correct address offset values for alpha and color key control registers
Signed-off-by Leela Krishna Amudala <[email protected]>--- 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
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.
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
Signed-off-by Leela Krishna Amudala <[email protected]>--- 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@@ -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 caseVIDOSD_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_NR5drivers/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
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
Signed-off-by Leela Krishna Amudala <[email protected]>--- 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@@ -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 registerVIDOSD_C(1)will refer to Window 1 Alpha Control registerVIDOSD_C(2)will refer to Window 2 Alpha Control registerVIDOSD_C(3)will refer to Window 3 Alpha Control registerVIDOSD_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_W0separate for win 0 is good.Best Wishes,
Leela Krishna AmudalaQuoted 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_NR5
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
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
Signed-off-by Leela Krishna Amudala <[email protected]>--- 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@@ -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 registerVIDOSD_C(1)will refer to Window 1 Alpha Control registerVIDOSD_C(2)will refer to Window 2 Alpha Control registerVIDOSD_C(3)will refer to Window 3 Alpha Control registerVIDOSD_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_W0separate for win 0 is good.Best Wishes,
Leela Krishna AmudalaQuoted 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_NR5drivers/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
-1writel (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_W0register.
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