drm/exynos: Fix G2D core mulfunctioning issue
Subsystems (3)
Inki Dae
maintainerPATCH 3/7 drm/exynos: Fix G2D core mulfunctioning issue
From: YoungJun Cho <[email protected]>
This patch fixes G2D core mulfunctioning issue once g2d dma is started. Without 'DMA_HOLD_CMD_REG' register setting, there is only one interrupt after the execution to all command lists have been completed. And that induces watchdog. So this patch sets 'LIST_HOLD' command to the register so that command execution interrupt can be occured whenever each command list execution is finished.
--- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_g2d.c +8 -5
@@ -82,7 +82,7 @@#define G2D_DMA_LIST_DONE_COUNT_OFFSET 17/* G2D_DMA_HOLD_CMD */ -#define G2D_USET_HOLD (1 << 2) +#define G2D_USER_HOLD (1 << 2)#define G2D_LIST_HOLD (1 << 1)#define G2D_BITBLT_HOLD (1 << 0)
@@ -863,10 +863,13 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data, cmdlist->data[cmdlist->last++] =G2D_SRC_BASE_ADDR ; cmdlist->data[cmdlist->last++] =0 ; -if (node->event) { - cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; - cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ; - } +/* +* 'LIST_HOLD' command should be set to the DMA_HOLD_CMD_REG +* if user wants G2D interrupt event once each command list or +* BitBLT command execution is finished. +*/ + cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; + cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ;/* Check size of cmdlist: last 2 is about G2D_BITBLT_START */ size = cmdlist->last + req->cmd_nr *2 + req->cmd_buf_nr *2 +2 ;
Signature · 1 line
1.7.4.1
Quoted 8 lines · Inki Dae
From: YoungJun Cho <[email protected]>
This patch fixes G2D core mulfunctioning issue once g2d dma is started. Without '
DMA_HOLD_CMD_REG' register setting, there is only one interrupt after the execution to all command lists have been completed. And that induces watchdog. So this patch sets 'LIST_HOLD' command to the register so that command execution interrupt can be occured whenever each command list execution is finished.
No, this problem occurs as GCF bit of INTEN_REG register is enabled always. If wants to raise interrupt immediately after a command list finished, GCF bit should be enabled, and it also needs to enable of LIST Hold bit of DMA_HOLD_CMD_REG register. If one of the two is missed out, g2d hardware will not work normally sometimes.
This patch is just workaround and it can happen performance issue because g2d hardware stops a moment whenever a command list finished.
So, we need the way which enable GCF bit only when a command list completion interrupt needs.
Thanks.
Quoted 38 lines
Signed-off-by YoungJun Cho <[email protected]>Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)drivers/gpu/drm/exynos/exynos_drm_g2d.c +8
-5@@ -82,7 +82,7 @@#define G2D_DMA_LIST_DONE_COUNT_OFFSET 17/* G2D_DMA_HOLD_CMD */ -#define G2D_USET_HOLD (1 << 2) +#define G2D_USER_HOLD (1 << 2)#define G2D_LIST_HOLD (1 << 1)#define G2D_BITBLT_HOLD (1 << 0)@@ -863,10 +863,13 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data, cmdlist->data[cmdlist->last++] =G2D_SRC_BASE_ADDR ; cmdlist->data[cmdlist->last++] =0 ; -if (node->event) { - cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; - cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ; - } +/* +* 'LIST_HOLD' command should be set to the DMA_HOLD_CMD_REG +* if user wants G2D interrupt event once each command list or +* BitBLT command execution is finished. +*/ + cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; + cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ;/* Check size of cmdlist: last 2 is about G2D_BITBLT_START */ size = cmdlist->last + req->cmd_nr *2 + req->cmd_buf_nr *2 +2 ;
Inki Dae
maintainerQuoted 20 lines
-----Original Message-----
From: Joonyoung Shim [mailto:[email protected]]
Sent: Wednesday, March 13, 2013 6:53 PM
To: Inki Dae
Cc: [email protected]; [email protected]; [email protected]; [email protected]; YoungJun Cho
Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioning issueQuoted 8 lines · Inki Dae
From: YoungJun Cho <[email protected]>
This patch fixes G2D core mulfunctioning issue once g2d dma is started. Without '
DMA_HOLD_CMD_REG' register setting, there is only one interrupt after the execution to all command lists have been completed. And that induces watchdog. So this patch sets 'LIST_HOLD' command to the register so that command execution interrupt can be occured whenever each command list execution is finished.
Quoted 5 lines
No, this problem occurs as GCF bit of
INTEN_REGregister is enabled always. If wants to raise interrupt immediately after a command list finished, GCF bit should be enabled, and it also needs to enable of LIST Hold bit ofDMA_HOLD_CMD_REGregister. If one of the two is missed out, g2d hardware will not work normally sometimes.
Right, these two things(LIST HOLD command and GCF interrupt enabling) should be pair.
Quoted 7 lines
This patch is just workaround and it can happen performance issue because g2d hardware stops a moment whenever a command list finished.
So, we need the way which enable GCF bit only when a command list completion interrupt needs.
Agree. How about this? If node->event isn't NULL then set GCF to INTEN register in g2d_dma_start(). For this way, I already mentioned through internal email thread.
Quoted 42 lines
Thanks.
Review
Quoted 8 lines
Signed-off-by YoungJun Cho <[email protected]>Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/exynos/exynos_drm_g2d.cdrivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct drm_device
Quoted 13 lines
index 095520f..91bc4cc 100644
drivers/gpu/drm/exynos/exynos_drm_g2d.c +1
-1@@ -82,7 +82,7 @@#define G2D_DMA_LIST_DONE_COUNT_OFFSET 17/* G2D_DMA_HOLD_CMD */ -#define G2D_USET_HOLD (1 << 2) +#define G2D_USER_HOLD (1 << 2)#define G2D_LIST_HOLD (1 << 1)#define G2D_BITBLT_HOLD (1 << 0)@@ -863,10 +863,13 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device
*drm_dev, void *data,Quoted 17 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c +7
-4cmdlist->data[cmdlist->last++] =G2D_SRC_BASE_ADDR ; cmdlist->data[cmdlist->last++] =0 ; -if (node->event) { - cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; - cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ; - } +/* +* 'LIST_HOLD' command should be set to the DMA_HOLD_CMD_REG +* if user wants G2D interrupt event once each command list or +* BitBLT command execution is finished. +*/ + cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; + cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ;/* Check size of cmdlist: last 2 is about G2D_BITBLT_START */ size = cmdlist->last + req->cmd_nr *2 + req->cmd_buf_nr *2 +2 ;
Quoted 29 lines · Inki Dae
Quoted 18 lines
-----Original Message-----
From: Joonyoung Shim [mailto:[email protected]]
Sent: Wednesday, March 13, 2013 6:53 PM
To: Inki Dae
Cc: [email protected]; [email protected]; [email protected]; [email protected]; YoungJun Cho
Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioning issueQuoted 8 lines · Inki Dae
From: YoungJun Cho <[email protected]>
This patch fixes G2D core mulfunctioning issue once g2d dma is started. Without '
DMA_HOLD_CMD_REG' register setting, there is only one interrupt after the execution to all command lists have been completed. And that induces watchdog. So this patch sets 'LIST_HOLD' command to the register so that command execution interrupt can be occured whenever each command list execution is finished.Quoted 5 lines
No, this problem occurs as GCF bit of
INTEN_REGregister is enabled always. If wants to raise interrupt immediately after a command list finished, GCF bit should be enabled, and it also needs to enable of LIST Hold bit ofDMA_HOLD_CMD_REGregister. If one of the two is missed out, g2d hardware will not work normally sometimes.Right, these two things(LIST HOLD command and GCF interrupt enabling) should be pair.
Quoted 3 lines
This patch is just workaround and it can happen performance issue because g2d hardware stops a moment whenever a command list finished.
Quoted 6 lines
Quoted 3 lines
So, we need the way which enable GCF bit only when a command list completion interrupt needs.
Agree. How about this? If
node->eventisn't NULL then set GCF to INTEN register ing2d_dma_start(). For this way, I already mentioned through internal email thread.
No, Once set GCF, it is set on end. Who can clear it?
Quoted 43 lines
Quoted 42 lines
Thanks.
Review
Quoted 8 lines
Signed-off-by YoungJun Cho <[email protected]>Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/exynos/exynos_drm_g2d.cdrivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct drm_device
Quoted 13 lines
index 095520f..91bc4cc 100644
drivers/gpu/drm/exynos/exynos_drm_g2d.c +1
-1@@ -82,7 +82,7 @@#define G2D_DMA_LIST_DONE_COUNT_OFFSET 17/* G2D_DMA_HOLD_CMD */ -#define G2D_USET_HOLD (1 << 2) +#define G2D_USER_HOLD (1 << 2)#define G2D_LIST_HOLD (1 << 1)#define G2D_BITBLT_HOLD (1 << 0)@@ -863,10 +863,13 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device
*drm_dev, void *data,Quoted 17 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c +7
-4cmdlist->data[cmdlist->last++] =G2D_SRC_BASE_ADDR ; cmdlist->data[cmdlist->last++] =0 ; -if (node->event) { - cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; - cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ; - } +/* +* 'LIST_HOLD' command should be set to the DMA_HOLD_CMD_REG +* if user wants G2D interrupt event once each command list or +* BitBLT command execution is finished. +*/ + cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; + cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ;/* Check size of cmdlist: last 2 is about G2D_BITBLT_START */ size = cmdlist->last + req->cmd_nr *2 + req->cmd_buf_nr *2 +2 ;
Inki Dae
maintainerQuoted 10 lines
-----Original Message-----
From: Joonyoung Shim [mailto:[email protected]]
Sent: Wednesday, March 13, 2013 7:28 PM
To: Inki Dae
Cc: [email protected]; [email protected]; [email protected]; [email protected]; 'YoungJun Cho'
Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioning issue
Quoted 14 lines
Quoted 13 lines · Inki Dae
Quoted 13 lines
-----Original Message-----
From: Joonyoung Shim [mailto:[email protected]]
Sent: Wednesday, March 13, 2013 6:53 PM
To: Inki Dae
Cc: [email protected]; [email protected]; [email protected]; [email protected]; YoungJun Cho
Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioning issueQuoted 3 lines · Inki Dae
From: YoungJun Cho <[email protected]>
This patch fixes G2D core mulfunctioning issue once g2d dma is
started.
Quoted 21 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Without '
DMA_HOLD_CMD_REG' register setting, there is only oneinterrupt
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
after the execution to all command lists have been completed. And that induces watchdog. So this patch sets '
LIST_HOLD' command to theregister
Quoted 1 line
Quoted 1 line
Quoted 1 line
so that command execution interrupt can be occured whenever each
command
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
list execution is finished.
No, this problem occurs as GCF bit of
INTEN_REGregister is enabled always. If wants to raise interrupt immediately after a command list finished, GCF bit should be enabled, and it also needs to enable ofLIST
Quoted 3 lines
Quoted 2 lines
Hold bit of
DMA_HOLD_CMD_REGregister. If one of the two is missed out, g2d hardware will not work normally sometimes.Right, these two things(LIST HOLD command and GCF interrupt enabling)
should
Quoted 5 lines
be pair.
Quoted 3 lines
This patch is just workaround and it can happen performance issue because g2d hardware stops a moment whenever a command list finished.
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
So, we need the way which enable GCF bit only when a command list completion interrupt needs.
Agree. How about this? If
node->eventisn't NULL then set GCF to INTEN register ing2d_dma_start(). For this way, I already mentioned through internal email thread.No, Once set GCF, it is set on end. Who can clear it?
Maybe you say that g2d_dma_start() is called by exec ioctl so the GCF bit could be set by only last node. For this, We need to look into dma-driven command processing. Assume that two more command lists exist and they are executed at once. Then we CAN NOT GET each node while dma operation because the command lists of each node are executed by dma at once.
On other words, there is no way to enable GCF bit only in case that a command list completion interrupt is needed because the need is from user side.
So I think we need some policy for g2d driver. For example, if user wants to get event to each node, all nodes from the user should be operated with GCF bit otherwise without GCF bit.
Any other idea?
Quoted 41 lines
Quoted 17 lines
Quoted 17 lines
Thanks.
Review
Quoted 8 lines
Signed-off-by YoungJun Cho <[email protected]>Signed-off-by Inki Dae <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/exynos/exynos_drm_g2d.cQuoted 6 lines
index 095520f..91bc4cc 100644
drivers/gpu/drm/exynos/exynos_drm_g2d.c +0
-0@@ -82,7 +82,7 @@#define G2D_DMA_LIST_DONE_COUNT_OFFSET 17Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c +1
-1/* G2D_DMA_HOLD_CMD */ -#define G2D_USET_HOLD (1 << 2) +#define G2D_USER_HOLD (1 << 2)#define G2D_LIST_HOLD (1 << 1)#define G2D_BITBLT_HOLD (1 << 0)@@ -863,10 +863,13 @@ int exynos_g2d_set_cmdlist_ioctl(struct
drm_deviceQuoted 16 lines
Quoted 16 lines
*drm_dev, void *data,Quoted 15 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c +7
-4cmdlist->data[cmdlist->last++] =G2D_SRC_BASE_ADDR ; cmdlist->data[cmdlist->last++] =0 ; -if (node->event) { - cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; - cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ; - } +/* +* 'LIST_HOLD' command should be set to the DMA_HOLD_CMD_REG +* if user wants G2D interrupt event once each command list or +* BitBLT command execution is finished. +*/ + cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; + cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ;
Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct · line 874
Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_g2d.c +0
-0/* Check size of cmdlist: last 2 is about G2D_BITBLT_START
*/
Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct · line 875
Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_g2d.c +0
-0size = cmdlist->last + req->cmd_nr *2 + req->cmd_buf_nr *2
+ 2;
Quoted 1 line
Quoted 1 line
Quoted 57 lines · Inki Dae
Quoted 8 lines
-----Original Message-----
From: Joonyoung Shim [mailto:[email protected]]
Sent: Wednesday, March 13, 2013 7:28 PM
To: Inki Dae Cc:[email protected];[email protected]; [email protected];[email protected]; 'YoungJun Cho'
Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioning issueQuoted 13 lines
Quoted 12 lines · Inki Dae
Quoted 12 lines
-----Original Message-----
From: Joonyoung Shim [mailto:[email protected]]
Sent: Wednesday, March 13, 2013 6:53 PM
To: Inki Dae Cc:[email protected];[email protected]; [email protected];[email protected]; YoungJun Cho
Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioning issueQuoted 3 lines · Inki Dae
From: YoungJun Cho<[email protected]>
This patch fixes G2D core mulfunctioning issue once g2d dma is
started.
Quoted 21 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Without '
DMA_HOLD_CMD_REG' register setting, there is only oneinterrupt
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
after the execution to all command lists have been completed. And that induces watchdog. So this patch sets '
LIST_HOLD' command to theregister
Quoted 1 line
Quoted 1 line
Quoted 1 line
so that command execution interrupt can be occured whenever each
command
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
list execution is finished.
No, this problem occurs as GCF bit of
INTEN_REGregister is enabled always. If wants to raise interrupt immediately after a command list finished, GCF bit should be enabled, and it also needs to enable ofLIST
Quoted 3 lines
Quoted 2 lines
Hold bit of
DMA_HOLD_CMD_REGregister. If one of the two is missed out, g2d hardware will not work normally sometimes.Right, these two things(LIST HOLD command and GCF interrupt enabling)
should
Quoted 5 lines
be pair.
Quoted 3 lines
This patch is just workaround and it can happen performance issue because g2d hardware stops a moment whenever a command list finished.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
So, we need the way which enable GCF bit only when a command list completion interrupt needs.
Agree. How about this? If
node->eventisn't NULL then set GCF to INTEN register ing2d_dma_start(). For this way, I already mentioned through internal email thread.No, Once set GCF, it is set on end. Who can clear it?
Maybe you say that
g2d_dma_start()is called by exec ioctl so the GCF bit could be set by only last node. For this, We need to look into dma-driven command processing. Assume that two more command lists exist and they are executed at once. Then we CAN NOT GET each node while dma operation because the command lists of each node are executed by dma at once.
Quoted 3 lines
On other words, there is no way to enable GCF bit only in case that a command list completion interrupt is needed because the need is from user side.
I requested to Youngjun Cho whether it is possible to work and to insert a command to set GCF bit of INTEN in command list and he said it is possiable and works because clears GCF bit in irq handler if command list completion interrupt occurs.
Quoted 3 lines
So I think we need some policy for g2d driver. For example, if user wants to get event to each node, all nodes from the user should be operated with GCF bit otherwise without GCF bit.
Actually now there is no way to inform completion of a set of command lists to user on async mode. So, i think completion event of a set of command lists needs also.
Thanks.
Quoted 48 lines
Any other idea?
Quoted 41 lines
Quoted 17 lines
Quoted 17 lines
Thanks.
Review
Quoted 8 lines
Signed-off-by YoungJun Cho<[email protected]>Signed-off-by Inki Dae<[email protected]>Signed-off-by Kyungmin Park<[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/exynos/exynos_drm_g2d.cQuoted 6 lines
index 095520f..91bc4cc 100644
drivers/gpu/drm/exynos/exynos_drm_g2d.c +0
-0@@ -82,7 +82,7 @@#define G2D_DMA_LIST_DONE_COUNT_OFFSET 17Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c +1
-1/* G2D_DMA_HOLD_CMD */ -#define G2D_USET_HOLD (1 << 2) +#define G2D_USER_HOLD (1 << 2)#define G2D_LIST_HOLD (1 << 1)#define G2D_BITBLT_HOLD (1 << 0)@@ -863,10 +863,13 @@ int exynos_g2d_set_cmdlist_ioctl(struct
drm_deviceQuoted 16 lines
Quoted 16 lines
*drm_dev, void *data,Quoted 15 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c +7
-4cmdlist->data[cmdlist->last++] =G2D_SRC_BASE_ADDR ; cmdlist->data[cmdlist->last++] =0 ; -if (node->event) { - cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; - cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ; - } +/* +* 'LIST_HOLD' command should be set to the DMA_HOLD_CMD_REG +* if user wants G2D interrupt event once each command list or +* BitBLT command execution is finished. +*/ + cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; + cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ;Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct · line 874
Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_g2d.c +0
-0/* Check size of cmdlist: last 2 is about G2D_BITBLT_START */
Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct · line 875
Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_g2d.c +0
-0size = cmdlist->last + req->cmd_nr *2 + req->cmd_buf_nr *2 + 2;
Inki Dae
maintainerQuoted 77 lines
-----Original Message-----
From: Joonyoung Shim [mailto:[email protected]]
Sent: Thursday, March 14, 2013 11:30 AM
To: Inki Dae
Cc: [email protected]; [email protected]; [email protected]; [email protected]; 'YoungJun Cho'
Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioning issueQuoted 8 lines · Inki Dae
Quoted 8 lines
-----Original Message-----
From: Joonyoung Shim [mailto:[email protected]]
Sent: Wednesday, March 13, 2013 7:28 PM
To: Inki Dae Cc:[email protected];[email protected]; [email protected];[email protected]; 'YoungJun Cho'
Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioning issueQuoted 8 lines
Quoted 8 lines · Inki Dae
Quoted 7 lines
Quoted 7 lines
-----Original Message-----
From: Joonyoung Shim [mailto:[email protected]]
Sent: Wednesday, March 13, 2013 6:53 PM
To: Inki Dae Cc:[email protected];[email protected]; [email protected];[email protected]; YoungJun Cho
Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioningissue
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · Inki Dae
Quoted 3 lines
From: YoungJun Cho<[email protected]>
This patch fixes G2D core mulfunctioning issue once g2d dma is
started.
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Without '
DMA_HOLD_CMD_REG' register setting, there is only oneinterrupt
Quoted 1 line
Quoted 1 line
Quoted 1 line
after the execution to all command lists have been completed. And
that
Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
induces watchdog. So this patch sets '
LIST_HOLD' command to theregister
Quoted 1 line
Quoted 1 line
Quoted 1 line
so that command execution interrupt can be occured whenever each
command
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
list execution is finished.
No, this problem occurs as GCF bit of
INTEN_REGregister is enabled always. If wants to raise interrupt immediately after a command list finished, GCF bit should be enabled, and it also needs to enable ofLIST
Quoted 1 line
Quoted 1 line
Hold bit of
DMA_HOLD_CMD_REGregister. If one of the two is missedout,
Quoted 11 lines
Quoted 11 lines
Quoted 2 lines
Quoted 1 line
g2d hardware will not work normally sometimes.
Right, these two things(LIST HOLD command and GCF interrupt enabling)
should
Quoted 8 lines
be pair.
Quoted 6 lines
This patch is just workaround and it can happen performance issue because g2d hardware stops a moment whenever a command list finished.
So, we need the way which enable GCF bit only when a command list completion interrupt needs.
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
Agree. How about this? If
node->eventisn't NULL then set GCF to INTEN register ing2d_dma_start(). For this way, I already mentioned through internal email thread.No, Once set GCF, it is set on end. Who can clear it?
Maybe you say that
g2d_dma_start()is called by exec ioctl so the GCFbit
Quoted 1 line
could be set by only last node. For this, We need to look into dma-
driven
Quoted 1 line
command processing. Assume that two more command lists exist and they
are
Quoted 1 line
executed at once. Then we CAN NOT GET each node while dma operation
because
Quoted 4 lines
the command lists of each node are executed by dma at once.
On other words, there is no way to enable GCF bit only in case that a command list completion interrupt is needed because the need is from
Quoted 8 lines
user
Quoted 1 line
side.
I requested to Youngjun Cho whether it is possible to work and to insert a command to set GCF bit of INTEN in command list and he said it is possiable and works because clears GCF bit in irq handler if command list completion interrupt occurs.
Checked it out. It seems that the g2d dma could also access and control other registers(not rendering relevant ones) in the command list. So we could implement this approach that user can get event to each command list completion more simply.
With set_cmdlist ioctl with event, it makes GCF bit to be set to node->cmdlist and only ACF bit without event. Afterwards, whenever each command list is completed, G2D Core can aware of the interrupt source enabled(GCF or ACF) so interrupt will occurs properly.
Mr. Cho, please implement this approach and test it.
Quoted 10 lines
Quoted 1 line
So I think we need some policy for g2d driver. For example, if user
wants to
Quoted 1 line
get event to each node, all nodes from the user should be operated with
GCF
Quoted 1 line
bit otherwise without GCF bit.
Actually now there is no way to inform completion of a set of command lists to user on async mode. So, i think completion event of a set of command lists needs also.
I think it's enough to have only event to each command list because user wants to do something only whenever one bitblt command is completed. Maybe there is no use case to all command lists. Anyway, let's implement the above approach first. :)
Quoted 51 lines
Thanks.
Quoted 32 lines
Any other idea?
Quoted 29 lines
Quoted 17 lines
Quoted 17 lines
Thanks.
Review
Quoted 8 lines
Signed-off-by YoungJun Cho<[email protected]>Signed-off-by Inki Dae<[email protected]>Signed-off-by Kyungmin Park<[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/exynos/exynos_drm_g2d.cQuoted 6 lines
index 095520f..91bc4cc 100644
drivers/gpu/drm/exynos/exynos_drm_g2d.c +0
-0@@ -82,7 +82,7 @@#define G2D_DMA_LIST_DONE_COUNT_OFFSET 17Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c +1
-1/* G2D_DMA_HOLD_CMD */ -#define G2D_USET_HOLD (1 << 2) +#define G2D_USER_HOLD (1 << 2)#define G2D_LIST_HOLD (1 << 1)#define G2D_BITBLT_HOLD (1 << 0)@@ -863,10 +863,13 @@ int exynos_g2d_set_cmdlist_ioctl(struct
drm_deviceQuoted 4 lines
Quoted 4 lines
*drm_dev, void *data,Quoted 3 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c +0
-0cmdlist->data[cmdlist->last++] =G2D_SRC_BASE_ADDR ; cmdlist->data[cmdlist->last++] =0 ;Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data,
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c +3
-4-if (node->event) { - cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; - cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ; - } +/* +* 'LIST_HOLD' command should be set to the DMA_HOLD_CMD_REG +* if user wants G2D interrupt event once each command list or
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data,
Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c +4
-0+* BitBLT command execution is finished. +*/ + cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; + cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ;/* Check size of cmdlist: last 2 is about G2D_BITBLT_START */
Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct · line 875
Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_g2d.c +0
-0size = cmdlist->last + req->cmd_nr *2 + req->cmd_buf_nr *2 + 2;
Quoted 11 lines · Inki Dae
Quoted 11 lines
-----Original Message-----
From: Joonyoung Shim [mailto:[email protected]]
Sent: Thursday, March 14, 2013 11:30 AM
To: Inki Dae
Cc: [email protected]; [email protected]; [email protected]; [email protected]; 'YoungJun Cho'
Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioning issue
Quoted 8 lines
Quoted 8 lines · Inki Dae
Quoted 7 lines
Quoted 7 lines
-----Original Message-----
From: Joonyoung Shim [mailto:[email protected]]
Sent: Wednesday, March 13, 2013 7:28 PM
To: Inki Dae Cc:[email protected];[email protected]; [email protected];[email protected]; 'YoungJun Cho'
Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioning
issue
Quoted 19 lines
Quoted 19 lines
Quoted 9 lines
Quoted 9 lines · Inki Dae
Quoted 7 lines
Quoted 7 lines
-----Original Message-----
From: Joonyoung Shim [mailto:[email protected]]
Sent: Wednesday, March 13, 2013 6:53 PM
To: Inki Dae Cc:[email protected];[email protected]; [email protected];[email protected]; YoungJun Cho
Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioningissue
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · Inki Dae
Quoted 3 lines
From: YoungJun Cho<[email protected]>
This patch fixes G2D core mulfunctioning issue once g2d dma is
started.
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Without '
DMA_HOLD_CMD_REG' register setting, there is only oneinterrupt
Quoted 1 line
Quoted 1 line
Quoted 1 line
after the execution to all command lists have been completed. And
Quoted 8 lines
Quoted 8 lines
that
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
induces watchdog. So this patch sets '
LIST_HOLD' command to theregister
Quoted 1 line
Quoted 1 line
Quoted 1 line
so that command execution interrupt can be occured whenever each
command
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
list execution is finished.
No, this problem occurs as GCF bit of
INTEN_REGregister is enabled always. If wants to raise interrupt immediately after a command
list
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
finished, GCF bit should be enabled, and it also needs to enable of
LIST
Quoted 1 line
Quoted 1 line
Hold bit of
DMA_HOLD_CMD_REGregister. If one of the two is missedout,
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
g2d hardware will not work normally sometimes.
Right, these two things(LIST HOLD command and GCF interrupt
enabling)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
should
Quoted 4 lines
be pair.
Quoted 2 lines
This patch is just workaround and it can happen performance issue because g2d hardware stops a moment whenever a command list
finished.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
So, we need the way which enable GCF bit only when a command list completion interrupt needs.
Agree. How about this? If
node->eventisn't NULL then set GCF to
INTEN
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
register in
g2d_dma_start(). For this way, I already mentioned
through
Quoted 29 lines
Quoted 15 lines
Quoted 4 lines
Quoted 3 lines
Quoted 1 line
internal email thread.
No, Once set GCF, it is set on end. Who can clear it?
Maybe you say that
g2d_dma_start()is called by exec ioctl so the GCFbit
Quoted 1 line
could be set by only last node. For this, We need to look into dma-
driven
Quoted 1 line
command processing. Assume that two more command lists exist and they
are
Quoted 1 line
executed at once. Then we CAN NOT GET each node while dma operation
because
Quoted 4 lines
the command lists of each node are executed by dma at once.
On other words, there is no way to enable GCF bit only in case that a command list completion interrupt is needed because the need is from
Quoted 8 lines
user
Quoted 1 line
side.
I requested to Youngjun Cho whether it is possible to work and to insert a command to set GCF bit of INTEN in command list and he said it is possiable and works because clears GCF bit in irq handler if command list completion interrupt occurs.
Checked it out. It seems that the g2d dma could also access and control other registers(not rendering relevant ones) in the command list. So we could implement this approach that user can get event to each command list completion more simply.
Quoted 7 lines
With
set_cmdlistioctl with event, it makes GCF bit to be set tonode->cmdlistand only ACF bit without event. Afterwards, whenever each command list is completed, G2D Core can aware of the interrupt source enabled(GCF or ACF) so interrupt will occurs properly.Mr. Cho, please implement this approach and test it.
I tested it and checked working well.
I'll send patch again.
Thank you
Best regards YJ
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
So I think we need some policy for g2d driver. For example, if user
wants to
Quoted 1 line
get event to each node, all nodes from the user should be operated
with
Quoted 11 lines
Quoted 7 lines
GCF
Quoted 1 line
bit otherwise without GCF bit.
Actually now there is no way to inform completion of a set of command lists to user on async mode. So, i think completion event of a set of command lists needs also.
I think it's enough to have only event to each command list because user wants to do something only whenever one bitblt command is completed. Maybe there is no use case to all command lists. Anyway, let's implement the
above
Quoted 42 lines
approach first. :)
Quoted 40 lines
Thanks.
Quoted 38 lines
Any other idea?
Quoted 35 lines
Quoted 17 lines
Quoted 17 lines
Thanks.
Review
Quoted 8 lines
Signed-off-by YoungJun Cho<[email protected]>Signed-off-by Inki Dae<[email protected]>Signed-off-by Kyungmin Park<[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/exynos/exynos_drm_g2d.cQuoted 6 lines
index 095520f..91bc4cc 100644
drivers/gpu/drm/exynos/exynos_drm_g2d.c +0
-0@@ -82,7 +82,7 @@#define G2D_DMA_LIST_DONE_COUNT_OFFSET 17Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c +1
-1/* G2D_DMA_HOLD_CMD */ -#define G2D_USET_HOLD (1 << 2) +#define G2D_USER_HOLD (1 << 2)#define G2D_LIST_HOLD (1 << 1)#define G2D_BITBLT_HOLD (1 << 0)@@ -863,10 +863,13 @@ int exynos_g2d_set_cmdlist_ioctl(struct
drm_deviceQuoted 10 lines
Quoted 10 lines
*drm_dev, void *data,Quoted 9 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c +2
-4cmdlist->data[cmdlist->last++] =G2D_SRC_BASE_ADDR ; cmdlist->data[cmdlist->last++] =0 ; -if (node->event) { - cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; - cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ; - } +/* +* 'LIST_HOLD' command should be set to the
DMA_HOLD_CMD_REG
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct · line 868
Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_g2d.c +1
-0+* if user wants G2D interrupt event once each command
list
Quoted 9 lines
Quoted 9 lines
or
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c int exynos_g2d_set_cmdlist_ioctl(struct · line 874
Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_g2d.c +4
-0+* BitBLT command execution is finished. +*/ + cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; + cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ;/* Check size of cmdlist: last 2 is about G2D_BITBLT_START */
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_g2d.c +0
-0size = cmdlist->last + req->cmd_nr *2 + req->cmd_buf_nr
* 2
Quoted 6 lines
Quoted 1 line
Quoted 1 line
+ 2;
_______________________________________________
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
Inki Dae
maintainerPATCH v2 3/7 drm/exynos: Fix G2D core malfunctioning issue
In reply to Inki DaeFrom: YoungJun Cho <[email protected]>
This patch fixes G2D core malfunctioning issue once g2d dma is started. Without 'DMA_HOLD_CMD_REG' register setting, there is only one interrupt after the execution to all command lists have been completed. And that induces watchdog. So this patch sets 'LIST_HOLD' command to the register so that command execution interrupt can be occured whenever each command list execution is finished.
Changelog v2:
- Consider for interrupt setup to each command list and all command lists And correct typo.
--- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_g2d.c +15 -5
@@ -82,7 +82,7 @@#define G2D_DMA_LIST_DONE_COUNT_OFFSET 17/* G2D_DMA_HOLD_CMD */ -#define G2D_USET_HOLD (1 << 2) +#define G2D_USER_HOLD (1 << 2)#define G2D_LIST_HOLD (1 << 1)#define G2D_BITBLT_HOLD (1 << 0)
@@ -592,10 +592,6 @@ static void g2d_dma_start(struct g2d_data *g2d,pm_runtime_get_sync (g2d->dev);clk_enable (g2d->gate_clk); -/* interrupt enable */ -writel_relaxed (G2D_INTEN_ACF |G2D_INTEN_UCF |G2D_INTEN_GCF , - g2d->regs +G2D_INTEN ); -writel_relaxed (node->dma_addr, g2d->regs +G2D_DMA_SFR_BASE_ADDR );writel_relaxed (G2D_DMA_START , g2d->regs +G2D_DMA_COMMAND ); }
@@ -863,9 +859,23 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data, cmdlist->data[cmdlist->last++] =G2D_SRC_BASE_ADDR ; cmdlist->data[cmdlist->last++] =0 ; +/* +* 'LIST_HOLD' command should be set to the DMA_HOLD_CMD_REG +* and GCF bit should be set to INTEN register if user wants +* G2D interrupt event once current command list execution is +* finished. +* Otherwise only ACF bit should be set to INTEN register so +* that one interrupt is occured after all command lists +* have been completed. +*/ if (node->event) { + cmdlist->data[cmdlist->last++] =G2D_INTEN ; + cmdlist->data[cmdlist->last++] =G2D_INTEN_ACF |G2D_INTEN_GCF ; cmdlist->data[cmdlist->last++] =G2D_DMA_HOLD_CMD ; cmdlist->data[cmdlist->last++] =G2D_LIST_HOLD ; + }else { + cmdlist->data[cmdlist->last++] =G2D_INTEN ; + cmdlist->data[cmdlist->last++] =G2D_INTEN_ACF ; }/* Check size of cmdlist: last 2 is about G2D_BITBLT_START */
Signature · 1 line
1.7.4.1