OSDN Git Service

minigbm: rework flag API
authorGurchetan Singh <gurchetansingh@chromium.org>
Thu, 2 Mar 2017 04:14:39 +0000 (20:14 -0800)
committerchrome-bot <chrome-bot@chromium.org>
Thu, 16 Mar 2017 18:25:47 +0000 (11:25 -0700)
commit6b41fb55deae7d8ae00c33f7ce849d6fd6525d77
tree92d9f413a88e3cb3c330da5aaaecaeb541593cf3
parent4d22b4e285f02adfc65d6ae1d6469a0e13ee12ba
minigbm: rework flag API

We've been back and forth on the semantics of the flag API many
times, and the current situation is confusing.

Change the drivers so every combination defines a distinct type of
buffer. That means if the same format is in the combination list three
times, the tiling or format modifiers of one of those combinations must
be different from the other two.

Let's add a priority variable in struct supported_combination that
breaks ties. For example, if a consumer specifies BO_USE_TEXTURE,
we of course can texture from both linear and tiled buffers, but
because a tiled buffer's priority is greater, it will be chosen.

If a consumer specifies BO_USE_TEXTURE | BO_USE_SW_WRITE_OFTEN, the
tiled combination won't have the BO_USE_SW_WRITE_OFTEN flag and the
linear combination will be chosen.

We expect drivers to modify the combinations after querying KMS.
This is clunky using linked lists, so get rid of list.h and use arrays.

BUG=chromium:616275
TEST=all the following compiles:

emerge-cyan minigbm/arc-cros-gralloc
emerge-oak minigbm/arc-cros-gralloc
emerge-veyron_minnie-cheets minigbm/arc-cros-gralloc
emerge-peach_pi minigbm
emerge-nyan_big minigbm
emerge-jadeite minigbm

Tested with gbmtest on cyan, checked if Chrome boots

Change-Id: Ib3fccf6f0cb86c8ded45924297df3c06f8e49271
Reviewed-on: https://chromium-review.googlesource.com/448252
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
23 files changed:
amdgpu.c
cirrus.c
cros_gralloc/cros_alloc_device.cc
drv.c
drv.h
drv_priv.h
evdi.c
exynos.c
gbm.c
gma500.c
helpers.c
helpers.h
i915.c
list.h [deleted file]
marvell.c
mediatek.c
nouveau.c
rockchip.c
tegra.c
udl.c
vc4.c
vgem.c
virtio_gpu.c