drm: constify KMS property framework

I discovered there are things we can make const, so I decided to do it
all over the place. Having things const has documentary value.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2026-06-05 12:06:44 +03:00
parent 691c03858b
commit 630c8bbf2a
3 changed files with 12 additions and 12 deletions

View file

@ -868,17 +868,17 @@ drm_output_set_mode(struct weston_output *base,
const char *modeline);
void
drm_property_info_populate(struct drm_device *device,
drm_property_info_populate(const struct drm_device *device,
const struct drm_property_info *src,
struct drm_property_info *info,
unsigned int num_infos,
drmModeObjectProperties *props);
const drmModeObjectProperties *props);
uint64_t
drm_property_get_value(struct drm_property_info *info,
drm_property_get_value(const struct drm_property_info *info,
const drmModeObjectProperties *props,
uint64_t def);
uint64_t *
drm_property_get_range_values(struct drm_property_info *info,
const uint64_t *
drm_property_get_range_values(const struct drm_property_info *info,
const drmModeObjectProperties *props);
int
drm_plane_populate_formats(struct drm_plane *plane, const drmModePlane *kplane,

View file

@ -1428,8 +1428,8 @@ drm_plane_create(struct drm_device *device, const drmModePlane *kplane)
struct weston_compositor *compositor = b->compositor;
struct drm_plane *plane, *tmp;
drmModeObjectProperties *props;
uint64_t *zpos_range_values;
uint64_t *alpha_range_values;
const uint64_t *zpos_range_values;
const uint64_t *alpha_range_values;
plane = zalloc(sizeof(*plane));
if (!plane) {

View file

@ -389,7 +389,7 @@ enum drm_state_apply_mode {
* @param def Value to return if property is not found
*/
uint64_t
drm_property_get_value(struct drm_property_info *info,
drm_property_get_value(const struct drm_property_info *info,
const drmModeObjectProperties *props,
uint64_t def)
{
@ -437,8 +437,8 @@ drm_property_get_value(struct drm_property_info *info,
* @param info Internal structure for property to look up
* @param props Raw KMS properties for the target object
*/
uint64_t *
drm_property_get_range_values(struct drm_property_info *info,
const uint64_t *
drm_property_get_range_values(const struct drm_property_info *info,
const drmModeObjectProperties *props)
{
unsigned int i;
@ -571,11 +571,11 @@ wdrm_vrr_enabled_from_output(struct drm_output *drm_output)
* @param props DRM object properties for the object
*/
void
drm_property_info_populate(struct drm_device *device,
drm_property_info_populate(const struct drm_device *device,
const struct drm_property_info *src,
struct drm_property_info *info,
unsigned int num_infos,
drmModeObjectProperties *props)
const drmModeObjectProperties *props)
{
drmModePropertyRes *prop;
unsigned i, j;