From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B88228AAEB for ; Wed, 18 Feb 2026 14:50:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771426205; cv=none; b=pCOQSNom8he8xalWPjt7evEFYKR4M1e73KRG9Od3ow7Zvkf7ovKN5XAhQWIug4nTVhY7yVEYdXsdOK1x4S9rt/4ZO7yCOcfDvVzCFrpSgVxy7wV5IbErw61s2OlgYTQgXodg8QEPEyHTMlwU1IC+f9DMLd4wiVROA/gjAvNu0VI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771426205; c=relaxed/simple; bh=vpQQs8z15o4h6aVfyhUeRK9fQRgrbYbu9xy1HpDjv90=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hSPglfSYp4R555VsifIed7Qhf7kJJarNNNDrbYTbFr4YBvWA328FhF7ZHLlPTdvVtELlb+Uo9dOSv+WkQCga+urSCEZa5vErkYo98dn5y/zVSPKTt/D3mCFdwJ1L/hFYOCLlDBoPCGo6jrJIvT8k9isZ3jbS6aj3RG1hoM6yjVY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=gsjADQmZ; arc=none smtp.client-ip=80.241.56.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mailbox.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="gsjADQmZ" Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4fGKDJ4THMz9v0N; Wed, 18 Feb 2026 15:49:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1771426192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zxBCLyRvOJ5lqOVGE65eX36//gHoC2z4soCTqVkxnC4=; b=gsjADQmZjBy2F5dSOBk4gwmQaew+NNUoM0kun5/cNP/6LIpYUpBsW/ypmy/4c9it14wvEX gqiWMGKrsR3Snc6y+69LvAvSwo7mWyna/JAJzTHgEWtpBg4AxOuHvNd9s/AAeQfAHp9xJ1 awTxYRVhPvt3VZpKc3NtmGpkOQpI7vje8L1vwGdRSj5J13PEKFDe2m2U4kVJ9s7F3Wzj5r BWEOVPC/GiF8XIrgkOGa0e0OeH8saVe+kFXTjZzmGsIfYNB8JR58mgTFRokQwpslt2vEJw h4mkGMtTi1sn4HnBaRmjSubCG0G/BE4NKItE5qNBMABGAcoX+Zbvw75mLKIsVQ== Message-ID: Date: Wed, 18 Feb 2026 15:49:49 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [RFC PATCH v1 1/2] drm/syncobj: Add DRM_IOCTL_SYNCOBJ_QUERY_ERROR to query fence error status To: =?UTF-8?Q?Christian_K=C3=B6nig?= , Yicong Hui Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, skhan@linuxfoundation.org, david.hunter.linux@gmail.com, wayland-devel@lists.freedesktop.org, mesa-dev@lists.freedesktop.org References: <20260213120836.81283-1-yiconghui@gmail.com> <20260213120836.81283-2-yiconghui@gmail.com> <0e7c3ee9-54b1-4ecc-b960-6e2fda6ab3ae@amd.com> From: =?UTF-8?Q?Michel_D=C3=A4nzer?= Content-Language: en-CA In-Reply-To: <0e7c3ee9-54b1-4ecc-b960-6e2fda6ab3ae@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MBO-RS-ID: 255a56dab5c43b695d3 X-MBO-RS-META: 7a15mxse9kjrodfsn1tj5peigx31bk5x On 2/17/26 15:45, Christian König wrote: > On 2/17/26 15:35, Michel Dänzer wrote: >> On 2/17/26 11:29, Christian König wrote: >>>> >>>> @@ -732,6 +732,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = { >>>> DRM_IOCTL_DEF(DRM_IOCTL_MODE_LIST_LESSEES, drm_mode_list_lessees_ioctl, DRM_MASTER), >>>> DRM_IOCTL_DEF(DRM_IOCTL_MODE_GET_LEASE, drm_mode_get_lease_ioctl, DRM_MASTER), >>>> DRM_IOCTL_DEF(DRM_IOCTL_MODE_REVOKE_LEASE, drm_mode_revoke_lease_ioctl, DRM_MASTER), >>>> + DRM_IOCTL_DEF(DRM_IOCTL_SYNCOBJ_QUERY_ERROR, drm_syncobj_query_error_ioctl, >>>> + DRM_RENDER_ALLOW), >>> >>> My educated guess is that userspace doesn't want to call this IOCTL separately because of performance reasons. >>> >>> Instead add some additional flag to DRM_SYNCOBJ_WAIT_FLAGS_* so that the IOCTL aborts the wait and returns an error as soon as it sees any fence with an error. >>> >>> Another DRM_SYNCOBJ_QUERY_FLAGS_* is potentially also useful to query the error on a number of drm_syncobjs at the same time. >>> >>> But in general since this is not a HW feature the userspace developers need to voice their requirements and explain how they want to have that implemented. >> >> mutter currently doesn't use the syncobj-specific ioctls to wait for a syncobj (timeline point) to signal / check if it has. Instead, it uses drmSyncobjEventfd / drmSyncobjExportSyncFile to get an eventfd / sync_file representing the timeline point / fence, then checks the status of the fd and waits for it to signal using generic poll()-style functionality. So unless the error condition can be communicated via the latter (and plumbed through glib APIs), mutter would need to check for fence errors separately. > > Good point, poll() has a POLLERR flag for that but I have no idea if eventfd supports that in any way. So potentially doable as well but a bit more work. > > Using a new DRM_SYNCOBJ_QUERY_FLAGS_ERROR on all signaled syncobj as separate way to query if there was an error should work for you in the meantime? Yeah should be fine, though if POLLERR is possible, that might save constantly calling into the kernel to check for an error status that won't happen the vast majority of the time? The bigger question might be what user space can do with the error status. I wrote down some ideas for mutter in https://gitlab.gnome.org/GNOME/mutter/-/issues/4624 . -- Earthling Michel Dänzer \ GNOME / Xwayland / Mesa developer https://redhat.com \ Libre software enthusiast