[PATCH] EXA: Only return TRUE from ExaDoPrepareAccess if the driver hook succeeded.
Maarten Maathuis
madman2003 at gmail.com
Tue Dec 8 09:59:51 PST 2009
While i agree with your intention, you should clarify the comment.
Currently it reads:
Returns TRUE if pixmap can be accessed offscreen.
Something like this might be better:
Returns TRUE if pixmap access succeeded and it's a gpu pixmap.
Repeated prepare access will return FALSE.
2009/12/8 Michel Dänzer <michel at daenzer.net>:
> From: Michel Dänzer <daenzer at vmware.com>
>
> This is what's documented in the function header and expected by both callers
> which care about the return code. In particular, otherwise
> exaPrepareAccessReg_mixed may incorrectly free the system memory copy, e.g.
> when the same pixmap is both the destination and source of an operation.
>
> (The other place which cares is exaAssertNotDirty(), which is a classic
> specific debugging function not active normally)
>
> Signed-off-by: Michel Dänzer <daenzer at vmware.com>
> ---
> exa/exa.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/exa/exa.c b/exa/exa.c
> index 23a1388..c5c67fc 100644
> --- a/exa/exa.c
> +++ b/exa/exa.c
> @@ -304,7 +304,7 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
> for (i = 0; i < EXA_NUM_PREPARE_INDICES; i++) {
> if (pExaScr->access[i].pixmap == pPixmap) {
> pExaScr->access[i].count++;
> - return TRUE;
> + return FALSE;
> }
> }
>
> @@ -338,7 +338,7 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
> exaWaitSync (pScreen);
>
> if (pExaScr->info->PrepareAccess == NULL)
> - return TRUE;
> + return FALSE;
>
> if (index >= EXA_PREPARE_AUX_DEST &&
> !(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
> --
> 1.6.4.3
>
> _______________________________________________
> xorg-devel mailing list
> xorg-devel at lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-devel
>
More information about the xorg-devel
mailing list