[PATCH 07/17] drm/xe/oa/uapi: Define and parse OA stream properties

Umesh Nerlige Ramappa umesh.nerlige.ramappa at intel.com
Tue Dec 19 16:26:04 UTC 2023


On Mon, Dec 18, 2023 at 06:59:57PM -0800, Dixit, Ashutosh wrote:
>On Thu, 07 Dec 2023 22:43:19 -0800, Ashutosh Dixit wrote:
>>
>> +	/**
>> +	 * @DRM_XE_OA_PROPERTY_OPEN_FLAGS: CLOEXEC and NONBLOCK flags are
>> +	 * directly applied to returned OA fd. DISABLED opens the OA stream in a
>> +	 * DISABLED state (see @DRM_XE_PERF_IOCTL_ENABLE).
>> +	 */
>> +	DRM_XE_OA_PROPERTY_OPEN_FLAGS,
>> +#define DRM_XE_OA_FLAG_FD_CLOEXEC	(1 << 0)
>> +#define DRM_XE_OA_FLAG_FD_NONBLOCK	(1 << 1)
>> +#define DRM_XE_OA_FLAG_DISABLED		(1 << 2)
>
>I am wondering why these flags should be part of this uapi:
>
>* O_CLOEXEC and O_NONBLOCK can be set on the returned stream fd using fcntl
>  (see man 2 fcntl)

I think the O_CLOEXEC was used so that a fork doesn't carry over the fd 
to the child. For the OA use case, we want to prevent that.  However, 
these flags don't really need to be passed separately. They can be flags 
in the stream open property.

Umesh

>* DRM_XE_OA_FLAG_DISABLED can just be a stream open property, doesn't 
>need
>  to be a fd flag.
>
>Comments?


>
>Thanks.
>--
>Ashutosh


More information about the Intel-xe mailing list