[Libva] [PATCH] drm: remove va_drm_is_authenticated check
Emil Velikov
emil.l.velikov at gmail.com
Tue Nov 15 17:44:59 UTC 2016
On 15 November 2016 at 15:42, David Herrmann <dh.herrmann at gmail.com> wrote:
> Hi
>
> On Tue, Nov 15, 2016 at 4:24 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> If we do not use a render node we must authenticate. Doing the extra
>> GetClient calls/ioctls does not help much, so don't bother.
>>
>> Cc: David Herrmann <dh.herrmann at gmail.com>
>> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
>> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
>> ---
>> David, Daniel, I believe things are perfectly reasonable on kernel side.
>> If not please shout.
>> ---
>> va/drm/va_drm.c | 8 ++------
>> va/drm/va_drm_auth.c | 35 -----------------------------------
>> va/drm/va_drm_auth.h | 4 ----
>> 3 files changed, 2 insertions(+), 45 deletions(-)
>>
>> diff --git a/va/drm/va_drm.c b/va/drm/va_drm.c
>> index 08071cf..59e33fa 100644
>> --- a/va/drm/va_drm.c
>> +++ b/va/drm/va_drm.c
>> @@ -74,12 +74,8 @@ va_DisplayContextGetDriverName(
>> if (ret < 0)
>> return VA_STATUS_ERROR_OPERATION_FAILED;
>>
>> - if (!va_drm_is_authenticated(drm_state->fd)) {
>> - if (!va_drm_authenticate(drm_state->fd, magic))
>> - return VA_STATUS_ERROR_OPERATION_FAILED;
>> - if (!va_drm_is_authenticated(drm_state->fd))
>> - return VA_STATUS_ERROR_OPERATION_FAILED;
>> - }
>> + if (!va_drm_authenticate(drm_state->fd, magic))
>> + return VA_STATUS_ERROR_OPERATION_FAILED;
>
> va_drm_authenticate() on native DRM returns EINVAL (via
> drmAuthMagic()) if already authenticated. Hence, this solution only
> works if you can guarantee that @drm_state->fd is not already
> authenticated.
>
> I don't know the VA internals, so cannot see whether this matters.
>
The API (vaGetDisplayDRM) isn't explicit if the device has to be auth.
yet I'm leaning towards no. Not to mention that every user of vaapi
[that I know of] does not do auth.
On the libva side, it's done once during vaInitialize and only when
using the DRM display (vaGetDisplayDRM).
-Emil
More information about the Libva
mailing list