From patchwork Wed Jul 20 10:56:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 34771 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1649:b0:8b:613a:194d with SMTP id no9csp2316704pzb; Wed, 20 Jul 2022 03:56:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uGs5nLL3iINNZ/7MxbusIIUc28ey1FDl8LzDrZbK/Ike2JJC2//VmvoKYtd0QXoFhzcFyA X-Received: by 2002:a17:907:9613:b0:72b:68df:8ada with SMTP id gb19-20020a170907961300b0072b68df8adamr35935931ejc.31.1658314618555; Wed, 20 Jul 2022 03:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658314618; cv=none; d=google.com; s=arc-20160816; b=Vjzwst27y23gQ8ZxAuQJl5jCQEIOx9zzLyz4D7vdnrdRkRg96otddjT6SHWp51MR88 OtcXBfzH+iicJwxdorybRKSX5tEVkVtBsRvDb3h4ilgUaePS8cysG/sdmDt2M8MCjgeK Vzm4jmrBoQfpcjk0KRd/yvuj2amWwHxD+v9f3jcUebdm9volp6QDfJ6oFHxKtj4BdvWN wrg9p2Na//DhRJ5fLntb/exShgU0CgaD4aUcCZ2CABVT1i+C/4EY0Zff+zPidAoaMEWV mg7KUpEBH7qZh6TPlUQ1e5LU5wIh3ZjL1zytG9p/WowepqiFSogo3t3Iq5L1oOnXadhS 9mwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=ax9qth+gLl/LOeplvZ87Uh9ZrNmSRwk+ZSckKk0Hfew=; b=OvZoTp3Vwi5ll8yYh6bTWGeUd7bBojNzFx2+RA8yEfLLXK51UYNnBjziJk9Qge18sc OSpEqx5ONEY8AnatPJu9OheKKOWG47mJ5uflTUO94/N8AkYgxidYBVnA/Q+6DZM9UYPR 4Re7OT3clSV948lpEm21l4XhoglJ9ArVNyXrm8GOGKBbQJNbzZ6iwK2i0Ur4p/PQA5zN cFKC9CTxomQBh970AQzLRs5mtpaVWAplGMNWgQiFPF0kOzfbCy50ij187Ncx3WiMS/Xn utBBIA9xI4WhWDNim9t0XsTcJGGNV4KMNPgDFAeXazi1YhBH9Xf4nV4FsSRTtxhE7G1Z 4bgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=nxJ4bPft; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id he43-20020a1709073dab00b0072b83d4de3asi27223007ejc.608.2022.07.20.03.56.57; Wed, 20 Jul 2022 03:56:58 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=nxJ4bPft; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3DB6D68B5CD; Wed, 20 Jul 2022 13:56:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4A6F768B4F7 for ; Wed, 20 Jul 2022 13:56:48 +0300 (EEST) Received: by mail-wr1-f49.google.com with SMTP id h8so2854373wrw.1 for ; Wed, 20 Jul 2022 03:56:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EiI5RUxzSe+dyW0S7UWWFU7/2uPkCqSEkS/eUENPLDk=; b=nxJ4bPftaiKreBFe237kS8VM1qWrQaBa7A8TTC3C/mVd/i8ssIdsL0Yg8JhPaeH2Qm VGaqC4YMRNIaWdYczOmMZtMhDSPmZBfBhiHK9LOcuqixZWkcSyH+UZSMAyfHw3HdVCcI RKKD+es+M7MNSBWsWYqLh/eKvIzuK5J97gjS60CUcn5gaEHeTpIqDWjQv7ERW3Qbbe/M b6JPMQZJmIxWJ3GJLc5z2YxBujP7AilFZLgTY8dx7B5iY99LOgxKlcxwtphtXnFWYBOX lD6oCIPMXaG5fe/HgCt4azEgRriVV/Vn9cQvPoCamUkOdie+dJi1+1pkMn3fHwihl9gy B2lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EiI5RUxzSe+dyW0S7UWWFU7/2uPkCqSEkS/eUENPLDk=; b=WVN12mc7QdUw2W/8iaazkr9iQFWRCzp6Itc7PPIJolZ5OooQhWKGTp+YiG38wU5ffS KsNODxRSZ4MunD+G4NH2Jgy8oOoPzbc5gMwduLxkA5ns6T/kA/xwFUBp9rtyyBUvXSNm qtIyEClqihueGK5w9bCCE4BPB/bsPE6153eCeU6wfOLWmrLnNtwHp/47lhVMoWW2msmr yWO5qmcc0sZRVFFjsrr7gR04yM4A5nGv7Qef5uj8ttcIgNoEoxYTgoxh/6rn8q/FFY/w MsliGpAUqJV3EGqSAwH3O27Fq6GWwEuNzv72UJLxT7iLnV2d9aL08RAJOIMwl25ur1Gt 45kg== X-Gm-Message-State: AJIora8bcbDKgPq+By5tb9NdP+UND6pZQRWooOivJ4/6yQ+5nga6OUuC on65U92lLyYH+YsXWwFhVj6e7AfMVdNz9Q== X-Received: by 2002:a5d:6c6f:0:b0:21d:c28a:2f99 with SMTP id r15-20020a5d6c6f000000b0021dc28a2f99mr24960890wrz.448.1658314607347; Wed, 20 Jul 2022 03:56:47 -0700 (PDT) Received: from localhost ([2a00:5f00:102:0:a792:c012:897f:7da6]) by smtp.gmail.com with UTF8SMTPSA id u17-20020a5d5151000000b0021d7799cf4csm15456744wrt.61.2022.07.20.03.56.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Jul 2022 03:56:46 -0700 (PDT) From: Emil Velikov To: ffmpeg-devel@ffmpeg.org Date: Wed, 20 Jul 2022 11:56:43 +0100 Message-Id: <20220720105646.716398-1-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.37.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 0/3] hwcontext_vaapi: dlopen libva-x11 and libva-drm X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Mark Thompson , emil.l.velikov@gmail.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: HwmcRXOLw43Z Greetings everyone, As you may know the libva* set of libraries share an internal ABI between them. In a resent libva commit, the va_fool API was removed. Thus if one is to mix different versions of libva.so and libva-x11.so they will get an error, leading to a crash of the whole stack. The simple solution is to dlopen() the winsys components, like libva-x11 and libva-drm. The changes are pretty minor and allow us to handle this king of issues. Comments and suggestions are welcome, but please me gentle it's my first time hacking on ffmpeg :-P Thanks Emil Aside: - Please consider backporting it to the stable branches in due time. - I've noticed that we leak state in the error paths, happy to send follow-up patches if you'd like those fixed. - My TODO includes reducing the massive ABI between libva* and backend drivers, to a single extra "registration" API entrypoint. --- Changes in v2: - Add libdl dependency, to address underlinking with older glibc Emil Velikov (3): hwcontext_vaapi: do not link against libva-x11.so hwcontext_vaapi: do not link against libva-drm.so hwcontext_vaapi: #if guard VAAPI_DRM specifics configure | 3 +- libavutil/hwcontext_vaapi.c | 92 +++++++++++++++++++++++++++++++++++-- 2 files changed, 91 insertions(+), 4 deletions(-)