<p dir="ltr"><br>
On Mar 14, 2013 1:59 PM, "Inki Dae" <<a href="mailto:inki.dae@samsung.com">inki.dae@samsung.com</a>> wrote:<br>
><br>
><br>
><br>
> > -----Original Message-----<br>
> > From: Joonyoung Shim [mailto:<a href="mailto:jy0922.shim@samsung.com">jy0922.shim@samsung.com</a>]<br>
> > Sent: Thursday, March 14, 2013 11:30 AM<br>
> > To: Inki Dae<br>
> > Cc: <a href="mailto:airlied@linux.ie">airlied@linux.ie</a>; <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a>;<br>
> > <a href="mailto:kyungmin.park@samsung.com">kyungmin.park@samsung.com</a>; <a href="mailto:sw0312.kim@samsung.com">sw0312.kim@samsung.com</a>; 'YoungJun Cho'<br>
> > Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioning issue<br>
> ><br>
> > On 03/13/2013 07:53 PM, Inki Dae wrote:<br>
> > >> -----Original Message-----<br>
> > >> From: Joonyoung Shim [mailto:<a href="mailto:jy0922.shim@samsung.com">jy0922.shim@samsung.com</a>]<br>
> > >> Sent: Wednesday, March 13, 2013 7:28 PM<br>
> > >> To: Inki Dae<br>
> > >> <a href="mailto:Cc%3Aairlied@linux.ie">Cc:airlied@linux.ie</a>;<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a>;<br>
> > >> <a href="mailto:kyungmin.park@samsung.com">kyungmin.park@samsung.com</a>;<a href="mailto:sw0312.kim@samsung.com">sw0312.kim@samsung.com</a>; 'YoungJun Cho'<br>
> > >> Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioning issue<br>
> > >><br>
> > >> On 03/13/2013 07:14 PM, Inki Dae wrote:<br>
> > >>>> -----Original Message-----<br>
> > >>>> From: Joonyoung Shim [mailto:<a href="mailto:jy0922.shim@samsung.com">jy0922.shim@samsung.com</a>]<br>
> > >>>> Sent: Wednesday, March 13, 2013 6:53 PM<br>
> > >>>> To: Inki Dae<br>
> > >>>> <a href="mailto:Cc%3Aairlied@linux.ie">Cc:airlied@linux.ie</a>;<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a>;<br>
> > >>>> <a href="mailto:kyungmin.park@samsung.com">kyungmin.park@samsung.com</a>;<a href="mailto:sw0312.kim@samsung.com">sw0312.kim@samsung.com</a>; YoungJun Cho<br>
> > >>>> Subject: Re: [PATCH 3/7] drm/exynos: Fix G2D core mulfunctioning<br>
> > issue<br>
> > >>>><br>
> > >>>> On 03/13/2013 06:04 PM, Inki Dae wrote:<br>
> > >>>>> From: YoungJun Cho<<a href="mailto:yj44.cho@samsung.com">yj44.cho@samsung.com</a>><br>
> > >>>>><br>
> > >>>>> This patch fixes G2D core mulfunctioning issue once g2d dma is<br>
> > > started.<br>
> > >>>>> Without 'DMA_HOLD_CMD_REG' register setting, there is only one<br>
> > >> interrupt<br>
> > >>>>> after the execution to all command lists have been completed. And<br>
> > that<br>
> > >>>>> induces watchdog. So this patch sets 'LIST_HOLD' command to the<br>
> > >> register<br>
> > >>>>> so that command execution interrupt can be occured whenever each<br>
> > >> command<br>
> > >>>>> list execution is finished.<br>
> > >>>> No, this problem occurs as GCF bit of INTEN_REG register is enabled<br>
> > >>>> always. If wants to raise interrupt immediately after a command list<br>
> > >>>> finished, GCF bit should be enabled, and it also needs to enable of<br>
> > >> LIST<br>
> > >>>> Hold bit of DMA_HOLD_CMD_REG register. If one of the two is missed<br>
> > out,<br>
> > >>>> g2d hardware will not work normally sometimes.<br>
> > >>> Right, these two things(LIST HOLD command and GCF interrupt enabling)<br>
> > >> should<br>
> > >>> be pair.<br>
> > >>><br>
> > >>>> This patch is just workaround and it can happen performance issue<br>
> > >>>> because g2d hardware stops a moment whenever a command list finished.<br>
> > >>>><br>
> > >>>> So, we need the way which enable GCF bit only when a command list<br>
> > >>>> completion interrupt needs.<br>
> > >>>><br>
> > >>> Agree. How about this? If node->event isn't NULL then set GCF to INTEN<br>
> > >>> register in g2d_dma_start(). For this way, I already mentioned through<br>
> > >>> internal email thread.<br>
> > >> No, Once set GCF, it is set on end. Who can clear it?<br>
> > >><br>
> > > Maybe you say that g2d_dma_start() is called by exec ioctl so the GCF<br>
> > bit<br>
> > > could be set by only last node. For this, We need to look into dma-<br>
> > driven<br>
> > > command processing. Assume that two more command lists exist and they<br>
> > are<br>
> > > executed at once. Then we CAN NOT GET each node while dma operation<br>
> > because<br>
> > > the command lists of each node are executed by dma at once.<br>
> > ><br>
> > > On other words, there is no way to enable GCF bit only in case that a<br>
> > > command list completion interrupt is needed because the need is from<br>
> > user<br>
> > > side.<br>
> ><br>
> > I requested to Youngjun Cho whether it is possible to work and to insert<br>
> > a command to set GCF bit of INTEN in command list and he said it is<br>
> > possiable and works because clears GCF bit in irq handler if command<br>
> > list completion interrupt occurs.<br>
> ><br>
><br>
> Checked it out. It seems that the g2d dma could also access and control<br>
> other registers(not rendering relevant ones) in the command list. So we<br>
> could implement this approach that user can get event to each command list<br>
> completion more simply.<br>
><br>
> With set_cmdlist ioctl with event, it makes GCF bit to be set to<br>
> node->cmdlist and only ACF bit without event. Afterwards, whenever each<br>
> command list is completed, G2D Core can aware of the interrupt source<br>
> enabled(GCF or ACF) so interrupt will occurs properly.<br>
><br>
> Mr. Cho, please implement this approach and test it.<br>
></p>
<p dir="ltr">I tested it and checked working well.</p>
<p dir="ltr">I'll send patch again.</p>
<p dir="ltr">Thank you</p>
<p dir="ltr">Best regards YJ</p>
<p dir="ltr">><br>
> > > So I think we need some policy for g2d driver. For example, if user<br>
> > wants to<br>
> > > get event to each node, all nodes from the user should be operated with<br>
> > GCF<br>
> > > bit otherwise without GCF bit.<br>
> ><br>
> > Actually now there is no way to inform completion of a set of command<br>
> > lists to user on async mode. So, i think completion event of a set of<br>
> > command lists needs also.<br>
> ><br>
><br>
> I think it's enough to have only event to each command list because user<br>
> wants to do something only whenever one bitblt command is completed. Maybe<br>
> there is no use case to all command lists. Anyway, let's implement the above<br>
> approach first. :)<br>
><br>
> > Thanks.<br>
> ><br>
> > ><br>
> > > Any other idea?<br>
> > ><br>
> > >>>> Thanks.<br>
> > >>>><br>
> > >>>>> Signed-off-by: YoungJun Cho<<a href="mailto:yj44.cho@samsung.com">yj44.cho@samsung.com</a>><br>
> > >>>>> Signed-off-by: Inki Dae<<a href="mailto:inki.dae@samsung.com">inki.dae@samsung.com</a>><br>
> > >>>>> Signed-off-by: Kyungmin Park<<a href="mailto:kyungmin.park@samsung.com">kyungmin.park@samsung.com</a>><br>
> > >>>>> ---<br>
> > >>>>> drivers/gpu/drm/exynos/exynos_drm_g2d.c | 13 ++++++++-----<br>
> > >>>>> 1 files changed, 8 insertions(+), 5 deletions(-)<br>
> > >>>>><br>
> > >>>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c<br>
> > >>>> b/drivers/gpu/drm/exynos/exynos_drm_g2d.c<br>
> > >>>>> index 095520f..91bc4cc 100644<br>
> > >>>>> --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c<br>
> > >>>>> +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c<br>
> > >>>>> @@ -82,7 +82,7 @@<br>
> > >>>>> #define G2D_DMA_LIST_DONE_COUNT_OFFSET 17<br>
> > >>>>><br>
> > >>>>> /* G2D_DMA_HOLD_CMD */<br>
> > >>>>> -#define G2D_USET_HOLD (1 << 2)<br>
> > >>>>> +#define G2D_USER_HOLD (1 << 2)<br>
> > >>>>> #define G2D_LIST_HOLD (1 << 1)<br>
> > >>>>> #define G2D_BITBLT_HOLD (1 << 0)<br>
> > >>>>><br>
> > >>>>> @@ -863,10 +863,13 @@ int exynos_g2d_set_cmdlist_ioctl(struct<br>
> > >> drm_device<br>
> > >>>> *drm_dev, void *data,<br>
> > >>>>> cmdlist->data[cmdlist->last++] = G2D_SRC_BASE_ADDR;<br>
> > >>>>> cmdlist->data[cmdlist->last++] = 0;<br>
> > >>>>><br>
> > >>>>> - if (node->event) {<br>
> > >>>>> - cmdlist->data[cmdlist->last++] = G2D_DMA_HOLD_CMD;<br>
> > >>>>> - cmdlist->data[cmdlist->last++] = G2D_LIST_HOLD;<br>
> > >>>>> - }<br>
> > >>>>> + /*<br>
> > >>>>> + * 'LIST_HOLD' command should be set to the DMA_HOLD_CMD_REG<br>
> > >>>>> + * if user wants G2D interrupt event once each command list<br>
> > or<br>
> > >>>>> + * BitBLT command execution is finished.<br>
> > >>>>> + */<br>
> > >>>>> + cmdlist->data[cmdlist->last++] = G2D_DMA_HOLD_CMD;<br>
> > >>>>> + cmdlist->data[cmdlist->last++] = G2D_LIST_HOLD;<br>
> > >>>>><br>
> > >>>>> /* Check size of cmdlist: last 2 is about G2D_BITBLT_START<br>
> > > */<br>
> > >>>>> size = cmdlist->last + req->cmd_nr * 2 + req->cmd_buf_nr * 2<br>
> > > + 2;<br>
><br>
> _______________________________________________<br>
> dri-devel mailing list<br>
> <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</p>