1
0
Fork 0
Commit graph

14 commits

Author SHA1 Message Date
Andrew Wolfers
9255d0d10b drm_hwcomposer: Migrate to android::drm_hwcomposer namespace
Change-Id: I2859aa8f55532d88231389724956fc77b0625339
2025-09-08 18:53:00 +00:00
Andrew Wolfers
d47f2255d2 drm_hwcomposer: Fix log warnings in DrmProprty::GetBlobData
Change-Id: I02dbe32a6579d57a4162986a07406635caa0220d
Signed-off-by: Andrew Wolfers <aswolfers@google.com>
2025-02-27 14:16:37 +00:00
Andrew Wolfers
e778d038e2 drm_hwcomposer: Add blob support to DrmProperty
This changes adds support for accessing blob data of DrmProperties with
type casting. When invoked, the data corresponding to the blob id
indicated by the property value is read from the device, and returned
as a vector with the provided template typing.

This change adds the fd as an additional init parameter for DrmProperty,
which is required in order to read the blob data.

Change-Id: I9531d0e7e2f13a4fd2840564783859d1dec1efd5
Signed-off-by: Andrew Wolfers <aswolfers@google.com>
2025-02-25 14:50:11 +00:00
Drew Davenport
5b5835675b drm_hwcomposer: Fix bitmask property mask creation
Enum properties may have the flag DRM_MODE_PROP_BITMASK to indicate that
the enum values should be interpreted as bitshifts.

- Add a function DrmProperty::IsBitmask to check if this flag is set
- Check that this flag is set in DrmProperty::GetEnumMask
- Fix GetEnumMask to interpret the enum value as a bitshift

Fixes: da2fcf66 ("drm_hwcomposer: Simplify LayerTransform")
Change-Id: Ice50ac23344f508b6dee761a51879da99d848007
Signed-off-by: Drew Davenport <ddavenport@google.com>
2025-01-29 09:09:05 -07:00
Roman Stratiienko
da2fcf6676 drm_hwcomposer: Simplify LayerTransform
Fixes clang-analyzer-optin.core.EnumCastOutOfRange clang tidy check.

Change-Id: I0a88d1ef084848c924198e8bd3831533b6578675
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2025-01-24 23:33:35 +02:00
Tim Van Patten
a2f3efa162 drm_hwcomposer: Implement getDisplayPhysicalOrientation()
Implement ComposerClient::getDisplayPhysicalOrientation() by querying
the DRM display panel orientation property and translating the result to
the correct common::Transform enum value.

The result is used by SurfaceFlinger to correctly rotate the image
before displaying it to the user.

Signed-off-by: Tim Van Patten <timvp@google.com>
2024-10-22 12:05:49 -06:00
Roman Stratiienko
abd8e534d9 drm_hwcomposer: Rework DrmProperty class
Simplify code and raise-up clang-tidy level of DrmProperty class
to 'normal'.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2022-12-11 21:19:43 +02:00
Roman Stratiienko
bde95666cf drm_hwcomposer: Use pragma once instead of include guards
Some of existing include guards were copy-pasted without modification,
therefore have incorrect name. Switch to 'pragma once' in order to fix
it and avoid such copy-paste issues in the future.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2022-12-10 20:37:34 +02:00
Roman Stratiienko
e78235c0be drm_hwcomposer: CI: Raise clang-tidy level from NONE to COARSE for *.h
To improve CI coverage.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12 10:33:55 +02:00
Roman Stratiienko
0f679aadfe drm_hwcomposer: Cleanup DrmPlane::Init()
Adding enum value into map looks ugly.
Create a wrapper in order to fix it.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-09-29 12:59:48 +03:00
Roman Stratiienko
7fd8f88c55 drm_hwcomposer: Cleanup DRM atomic commit
Create and use DrmPlane::AtomicSet() wrapper.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2021-09-29 12:46:54 +03:00
Benjamin Li
9127dc8834 drm_hwcomposer: add DRM_PROPERTY_TYPE_BITMASK
Bitmask properties are integers that additionally have strings associated
with each bit. For example, the "rotation" property's bits are described
as "rotate-90", "reflect-x", and so on.

The bitmask integer is not actually passed to us -- instead, the interface
for enums is used, except that more than one value can be set. This means we
must query using the associated strings, rather than use bit index mappings
provided as constants in the public kernel header drm_mode.h.

Signed-off-by: Benjamin Li <benl@squareup.com>
2021-05-07 16:28:30 -07:00
Roman Stratiienko
e2f2c92924 drm_hwcomposer: enable code analysis using clang-tidy
Drm hwcomposer project has some code-style inconsistencies.
This is the initial step to unify code-style of the code.

Clang-tidy is a great tool which can not only suggest correct styling,
but also allow predicting the errors in the code and suggest correct
coding approaches to avoid potential weaknesses.

CI was tuned to check clang-tidy recommendation for some part of the
code which is ready ATM (can be built outside AOSP tree).
For this part a limited set of clang-tidy checks has applied (coarse check).
Header files aren't checked at all.

Starting from now new code files must be included into the list that is
checked by almost all clang-tidy checks (fine checklist). New header files
should be also included into this list.
See '.gitlab-ci-clang-tidy-fine.sh'.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2021-03-03 16:07:25 +02:00
Roman Stratiienko
13cc3666c6 drm_hwcomposer: use CamelCase in source/header files related to class
Main goal is to increase readability of file names.
AOSP uses camelcase for files in many projects.
Lets do the same for drm_hwcomposer.

Keep platform/ directory as is, since class names is different from file names.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: I7e992357851c2a86711f4da1241c4d507359e56b
2020-09-08 22:34:52 +03:00
Renamed from drm/drmproperty.h (Browse further)