Commit graph

9 commits

Author SHA1 Message Date
Mike Frysinger
bc47e98159 UPSTREAM: presubmit: switch to cros format
Rather than use `clang-format` from $PATH (which changes between devs),
use `cros format` which has a pinned version for all people.

Add *.cpp to the include list as not all C++ files use *.cc.

Then run format on the files to fix latent issues.

BUG=None
TEST=./presubmit.sh

Change-Id: I28e167d454a7b089bb79e932b7265fa87e4c331f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6475964
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Ryan Neph <ryanneph@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>

Bug: None
Test: lunch brya-trunk_staging-userdebug && m libminigbm_gralloc
Change-Id: I23022dbb536ade53951fe61014c5056e114f4bbc
2025-06-24 17:37:57 -07:00
Andrew Wolfers
a4f32f9172 xe: Add CURSOR_USAGE buffer padding
This change modifies buffer allocation to include necessary padding
for buffers with the BO_USE_CURSOR flag. This behavior mirrors
identical logic in the i915 implementation.

Bug: b/417750580
Change-Id: I3358678fd194eff24fad2cb3749ca59bac33afb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6546486
Commit-Queue: Andrew Wolfers <aswolfers@chromium.org>
Tested-by: Andrew Wolfers <aswolfers@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Drew Davenport <ddavenport@chromium.org>
2025-05-15 19:39:14 +00:00
Juston Li
724084e75f UPSTREAM: xe: support BO_USE_GPU_DATA_BUFFER for image storage formats
Android gralloc via AIDL allows use of AHB-backed external memory for
storage images with usage AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER; its
equivalents are VK_IMAGE_USAGE_STORAGE_BIT/BO_USE_GPU_DATA_BUFFER.

On older interfaces before gralloc 4.1/AIDL, BO_USE_GPU_DATA_BUFFER
is only allowed for BLOB formats; this adds it to combinations with
non-BLOB formats for the newer interfaces.

The image_storage_formats list is a subset of the formats being used
that support VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT which for anv is
power-of-two formats; here it ends up excluding the YCbCr formats.

Bug: 397763052
Test: dEQP-VK.wsi.android.[display_timing.*/ swapchain*]

Change-Id: I6b034790fa77f15fb341acfae4a45255231a5a14
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6442090
Commit-Queue: Juston Li <justonli@google.com>
Commit-Queue: ChromeOS Auto Runner <chromeos-auto-runner@chromeos-bot.iam.gserviceaccount.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Tested-by: Juston Li <justonli@google.com>
(cherry picked from commit db68fa51e4b7ed19546c80806da9f462c3b5c8d7)
2025-04-22 22:34:30 +00:00
Ryan Neph
e37e16203f xe: add lnl/ptl pci ids
IDs match those added to mesa in:
* https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29273
* https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31838
* https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32149

Also sets the correct graphics_version but still uses the unsavory
is_mtl_or_newer flag, which will later be replaced by explicit version
testing at each special-case or initialization of per-version
capabilities.

Bug: b:358427077
Test: Builds, CQ
Change-Id: I5368c0a2da00a42c70f7c6cf7740fad5ca1cea2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6254318
Commit-Queue: Ryan Neph <ryanneph@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Lina Versace <linyaa@google.com>
Tested-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Matt Turner <msturner@google.com>
2025-02-11 14:24:15 -08:00
Ryan Neph
e2726068a7 xe: use WC memtype only for SCANOUT
Prefer WB memtype unless passed SCANOUT flag (then use WC).

BUG=b:358427077
TEST=drm-tests

Change-Id: Idc35fb901f176013b921d292c7a946f19b7ac826
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6245163
Reviewed-by: Matt Turner <msturner@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Tested-by: Ryan Neph <ryanneph@google.com>
Commit-Queue: Ryan Neph <ryanneph@google.com>
Reviewed-by: Lina Versace <linyaa@google.com>
2025-02-10 11:07:57 -08:00
Ryan Neph
4a5d3773fb xe: ensure YVU420_ANDROID total_size is aligned to pagesize
The Xe kmd requires it but it was missed when calculating the total_size
of YVU420_ANDROID buffers.

BUG=b:358427077
TEST=drm-tests

Change-Id: I2f201b9ba7d12a70074333f6ad4a0fbfeb77c3a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6245162
Tested-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Matt Turner <msturner@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Commit-Queue: Ryan Neph <ryanneph@google.com>
Reviewed-by: Lina Versace <linyaa@google.com>
2025-02-10 11:07:55 -08:00
Ryan Neph
f702a3b497 xe: stop searching device ids after first match
gen12_ids array is inclusive of most of the ids in other arrays, so it
should be treated as a least-specific-fallback to the others, and come
last in search order and only if not matched in more-specific arrays
searched earlier.

BUG=b:358427077
TEST=drm-tests

Change-Id: I4f66b6a945d2dfa7288a81dfe3f314a9f2f63273
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6245161
Reviewed-by: Lina Versace <linyaa@google.com>
Reviewed-by: Matt Turner <msturner@google.com>
Tested-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Commit-Queue: Ryan Neph <ryanneph@google.com>
2025-02-10 11:07:54 -08:00
George D Sworo
3c48f8ad13 xe: retrieve device info using IOCTLs instead of libdrm API
BUG=b:358427077
TEST=drm-tests

Change-Id: I495ae665e224ef5704b796a8339cad562ed0c6c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6245160
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Tested-by: Ryan Neph <ryanneph@google.com>
Commit-Queue: Ryan Neph <ryanneph@google.com>
Reviewed-by: Matt Turner <msturner@google.com>
Reviewed-by: Lina Versace <linyaa@google.com>
2025-02-10 11:07:52 -08:00
Carlos Santa
3ab89b0247 xe: add initial Xe kmd support for gen12 xelp
Adds a new intel backend for interfacing with the Xe kernel driver.
Currently only tested on gen12 (Xe1; e.g. TGL, ADL, MTL).

Test 1: drm-tests (natively): stop ui and then run:
	- mapped_texture_test
	- null_platform_test -m [I915_FORMAT_MOD_X_TILED|I915_FORMAT_MOD_Y_TILED]
	- plane_test (by default it uses NV12)

Test 2: full OS: boot to UI, execute webGL and/or YouTube successfully and watch
the terminal: TERM=xterm watch -n1 -d cat /sys/kernel/debug/dri/0/i915_display_info
for color formats and display plane usage

v1: Carlos Santa <carlos.santa@intel.corp-partner.google.com>
v2: Ryan Neph <ryanneph@google.com>
  - formatting fixes
  - remove deprecated #ifdef I915_SCANOUT_Y_TILED conditional compilation
  - add missing backend_xe implementations
  - mimic i915_add_combinations
    - Match formatting, order of operations, and add the missing combo for
      YVU420_ANDROID + USE_CAMERA_WRITE.
    - In a future CL, we'll factor this into a common function called by both
      backends.
  - simplify xe_bo_map()
    - The conditional body is always taken, so remove the conditional entirely.
  - mark late-gen12 as mtl_or_newer until proper version handling is used.

BUG=b:358427077
TEST=drm-tests (see above)

Change-Id: I1eaa1dcce6cee706a421b3c4d6a532a6b83f8564
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6245159
Tested-by: Ryan Neph <ryanneph@google.com>
Commit-Queue: Ryan Neph <ryanneph@google.com>
Reviewed-by: Matt Turner <msturner@google.com>
Reviewed-by: Lina Versace <linyaa@google.com>
2025-02-10 11:07:50 -08:00