[PATCH 07/17] drm/xe/oa/uapi: Define and parse OA stream properties
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Tue Dec 19 16:29:56 UTC 2023
On 19/12/2023 18:26, Umesh Nerlige Ramappa wrote:
> 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
>
You know that the application can set those flags by using the fcntl()
syscall?
It doesn't look like it's a useful feature to add in the driver.
-Lionel
>> * 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