[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] linux-user: syscall: ioctls: support DRM_IOCTL_VERSION
From: |
Laurent Vivier |
Subject: |
Re: [PATCH] linux-user: syscall: ioctls: support DRM_IOCTL_VERSION |
Date: |
Wed, 11 Mar 2020 08:35:43 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
Le 10/03/2020 à 21:16, Laurent Vivier a écrit :
> Le 26/02/2020 à 12:38, address@hidden a écrit :
>> From: Chen Gang <address@hidden>
>>
>> The other DRM_IOCTL_* commands will be done later.
>>
>> Signed-off-by: Chen Gang <address@hidden>
>> ---
>> linux-user/ioctls.h | 3 +
>> linux-user/syscall.c | 134 +++++++++++++++++++++++++++++++++++++
>> linux-user/syscall_defs.h | 16 +++++
>> linux-user/syscall_types.h | 12 ++++
>> 4 files changed, 165 insertions(+)
>>
>> diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
>> index 0defa1d8c1..c2294b48a0 100644
>> --- a/linux-user/ioctls.h
>> +++ b/linux-user/ioctls.h
>> @@ -574,6 +574,9 @@
>> IOCTL_SPECIAL(SIOCDELRT, IOC_W, do_ioctl_rt,
>> MK_PTR(MK_STRUCT(STRUCT_rtentry)))
>>
>> + IOCTL_SPECIAL(DRM_IOCTL_VERSION, IOC_RW, do_ioctl_drm,
>> + MK_PTR(MK_STRUCT(STRUCT_drm_version)))
>> +
>
> Rather than adding a specific function to process the structure, perhaps
> we can add this in a generic way?
>
> The problem with drm_version structure is the pointers to the strings.
>
> Did you try to add a TYPE_STRING in
> thunk_type_size()/thunk_type_align()/think_convert()/do_ioctl() to do that?
In fact we can't do that because we need to know the size of the buffer
to allocate and it is provided by another field. It cannot be generic,
so I think what you do is the best we can do.
Thanks,
LAurent