dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
To: Chunming Zhou <david1.zhou@amd.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/syncobj: return meaningful value to user space
Date: Mon, 22 Jul 2019 11:46:35 +0300	[thread overview]
Message-ID: <79b2a068-412c-55ae-e094-14b9912b3e68@intel.com> (raw)
In-Reply-To: <20190718111339.25126-1-david1.zhou@amd.com>

On 18/07/2019 14:13, Chunming Zhou wrote:
> if WAIT_FOR_SUBMIT isn't set and in the meanwhile no underlying fence on syncobj,
> then return non-block error code to user sapce.
>
> Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
> ---
>   drivers/gpu/drm/drm_syncobj.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
> index 361a01a08c18..929f7c64f9a2 100644
> --- a/drivers/gpu/drm/drm_syncobj.c
> +++ b/drivers/gpu/drm/drm_syncobj.c
> @@ -252,7 +252,7 @@ int drm_syncobj_find_fence(struct drm_file *file_private,
>   			return 0;
>   		dma_fence_put(*fence);
>   	} else {
> -		ret = -EINVAL;
> +		ret = -ENOTBLK;


This will only return the new error when there is no chain fence in the 
syncobj?

Don't you want the new error code after dma_fence_chain_find_seqno() too?


Which make me realize there is probably a bug with this code :


ret = dma_fence_chain_find_seqno(fence, point);
if (!ret)
         return 0;
dma_fence_put(*fence);


Sounds like the condition should be

if (ret)

         return ret;


I realize we have introduced a blocking behavior on the transfer ioctl.

If we're going to change this to return EWOULDBLOCK, we might want to 
get rid of it.


-Lionel


>   	}
>   
>   	if (!(flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT))
> @@ -832,7 +832,7 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs,
>   			if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT) {
>   				continue;
>   			} else {
> -				timeout = -EINVAL;
> +				timeout = -ENOTBLK;
>   				goto cleanup_entries;
>   			}
>   		}


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-07-22  8:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-18 11:13 [PATCH] drm/syncobj: return meaningful value to user space Chunming Zhou
2019-07-18 11:18 ` Chris Wilson
2019-07-18 13:04   ` Chunming Zhou
2019-07-18 13:10     ` Chris Wilson
2019-07-18 13:15       ` Chunming Zhou
2019-07-18 13:23         ` Chris Wilson
2019-07-18 13:24         ` Chunming Zhou
2019-07-18 11:31 ` Lionel Landwerlin
2019-07-18 13:02   ` Chunming Zhou
2019-07-18 14:08     ` Lionel Landwerlin
2019-07-18 14:33       ` Chunming Zhou
2019-07-19  8:13         ` Lionel Landwerlin
2019-07-19  8:31           ` zhoucm1
2019-07-22  8:46 ` Lionel Landwerlin [this message]
2019-07-22 10:11   ` zhoucm1

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=79b2a068-412c-55ae-e094-14b9912b3e68@intel.com \
    --to=lionel.g.landwerlin@intel.com \
    --cc=david1.zhou@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox