We need use_flags when we implement the dri interface on top of hbm.
Also, dri_bo_create_with_modifiers does not take use flags only because
gbm_bo_create_with_modifiers does not. That has changed with
gbm_bo_create_with_modifiers2 although minigbm does not reflect that.
BUG=b:292148713
TEST=CQ
Change-Id: I120358c843140a937fee1dd6183d1836ea622eec
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5801181
Reviewed-by: Ryan Neph <ryanneph@google.com>
Commit-Queue: Chia-I Wu <olv@google.com>
Tested-by: Chia-I Wu <olv@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
There is no reason to leak the internals to backends.
BUG=b:292148713
TEST=CQ
Change-Id: I42215ad3add750f19d4a2f0a575a040d73bb19e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5801180
Commit-Queue: Chia-I Wu <olv@google.com>
Tested-by: Chia-I Wu <olv@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Make dri_driver a proper object that the backend can create, rather than
something that the backend must inherit from.
This makes dri_init return a dri_driver and make the rest dri_*
functions take a dri_driver. There is no functional change.
BUG=b:292148713
TEST=CQ
Change-Id: I3ef045d73b0015b5c6d926dec7bae69d35d94275
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5801179
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Commit-Queue: Chia-I Wu <olv@google.com>
Tested-by: Chia-I Wu <olv@google.com>
They will be used for preloading.
BUG=b:269664560
TEST="grep radeonsi /proc/$(pidof zygote)/maps" on grunt
Change-Id: I6134e00bf9e046889aea7e471b7f7bcf3972604c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4262033
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Chia-I Wu <olv@google.com>
Tested-by: Chia-I Wu <olv@google.com>
Previously these would get leaked if we had multiple bo structs
pointing to the same image/GEM BO as each has their own DRI image,
but bo_destroy only gets called on the last struct.
To mitigate this we have a new callback for every struct where we
can free the DRI image.
BUG=b:185869479
TEST=Repeatedly open/close camera app on Grunt.
Change-Id: I6188346b5bf9e5cbbbbf32a3db621a3fe0276d4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3270684
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>
For virtualization purposes we always want to have a modifier. With
radeonsi that means allocating with modifiers. This has the
complication that the structure of modifiers isn't trivial.
Three implementation options:
1) Add dri-flag to create bo with valid modifier
2) Figure out scanout capable modifiers in minigbm
3) Take scanout capable modifiers from kernel.
3 is an issue because the card node is often behind a video group
on desktop linux and we don't want to create something that won't
work on desktop linux.
For 2 I figured out that the structure is actually fairly simple if
we assume that the DRI driver doesn't provide useless modifiers.
For 1 we'd end up having to do the same work as 2 + define the
DRI interface + maybe have to deal with older somewhat buggy kernels.
So I ended up selecting 2.
Note that this also removes CURSOR usage in the old path with DRI
On AMD we only allow linear for the cursor so this gets handled
in the linear path.
BUG=b:192390822
TEST=Run vkcube on zork-arc-r.
Change-Id: Ibde0e2ec761e293486c8ee71cfd88d9846ba09da
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3086527
Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
This adds modifier support to minigbm in the amdgpu driver.
This includes
(a) creation of images with modifiers
(b) imports
- Had to distinguish between legacy and non-legacy.
(c) Support for planes > format planes
BUG=b:149819940
TEST=Login on a Zork device + play a YT video.
Change-Id: If58ada081aa254932e299536c48c18937266c2e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2093212
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>
If the driver does not implement the new function, or
if modifier is INVALID this should return exactly the
same as before.
For LINEAR, DRI should return exactly the same as
minigbm for all the YUV formats.
BUG=b:149819940
TEST=Use with followup patch and login on a Zork device + play a YT
video.
Change-Id: I6ea3b5827876844e510794b85212be51e5dfd68f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2093211
Tested-by: Bas Nieuwenhuizen <basni@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Bas Nieuwenhuizen <basni@chromium.org>
dri_interface.h now #includes GL/gl.h so there is no need to define
these.
BUG=b:143621384
TEST=build/deploy minigbm and arc-cros-gralloc for grunt
Cq-Depend: chromium:1907530
Change-Id: Ic370dc1404156c8e5de5dc9490a8c68b49661c00
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1912763
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Ilja H. Friedel <ihf@chromium.org>
Tested-by: Ilja H. Friedel <ihf@chromium.org>
Dri backend is not used for the all use flags. When same fd is
shared between dri backend and the minigbm drv, they end up using the
same kernel DRI context.
BUG=b:111081134
TEST=cheets_SurfaceComposition
graphics_Gbm
graphics_Gralloc
Change-Id: I47ae12391acfc9c947e8281de11472fcdf5dec5b
Signed-off-by: Satyajit Sahu <satyajit.sahu@amd.com>
Reviewed-on: https://chromium-review.googlesource.com/1164972
Tested-by: Deepak Sharma <deepak.sharma@amd.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>