XenevaOS
Loading...
Searching...
No Matches
drm_property.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 Intel Corporation
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
13 *
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20 * OF THIS SOFTWARE.
21 */
22
23#ifndef __DRM_PROPERTY_H__
24#define __DRM_PROPERTY_H__
25
26#include <linux/list.h>
27#include <linux/ctype.h>
28#include <drm/drm_mode_object.h>
29
30#include <uapi/drm/drm_mode.h>
31
53
199
224
226 int type;
227 const char *name;
228};
229
230#define obj_to_property(x) container_of(x, struct drm_property, base)
231#define obj_to_blob(x) container_of(x, struct drm_property_blob, base)
232
241static inline bool drm_property_type_is(struct drm_property *property,
242 uint32_t type)
243{
244 /* instanceof for props.. handles extended type vs original types: */
245 if (property->flags & DRM_MODE_PROP_EXTENDED_TYPE)
246 return (property->flags & DRM_MODE_PROP_EXTENDED_TYPE) == type;
247 return property->flags & type;
248}
249
251 u32 flags, const char *name,
252 int num_values);
254 u32 flags, const char *name,
255 const struct drm_prop_enum_list *props,
256 int num_values);
258 u32 flags, const char *name,
259 const struct drm_prop_enum_list *props,
260 int num_props,
261 uint64_t supported_bits);
263 u32 flags, const char *name,
266 u32 flags, const char *name,
269 u32 flags, const char *name,
270 uint32_t type);
272 u32 flags, const char *name);
274 uint64_t value, const char *name);
275void drm_property_destroy(struct drm_device *dev, struct drm_property *property);
276
278 size_t length,
279 const void *data);
281 uint32_t id);
283 struct drm_property_blob **blob,
284 uint64_t blob_id,
285 ssize_t expected_size,
286 ssize_t expected_elem_size,
287 ssize_t max_size,
288 bool *replaced);
290 struct drm_property_blob **replace,
291 size_t length,
292 const void *data,
293 struct drm_mode_object *obj_holds_id,
294 struct drm_property *prop_holds_id);
296 struct drm_property_blob *new_blob);
299
308static inline struct drm_property *drm_property_find(struct drm_device *dev,
309 struct drm_file *file_priv,
310 uint32_t id)
311{
312 struct drm_mode_object *mo;
314 return mo ? obj_to_property(mo) : NULL;
315}
316
317#endif
int64_t ssize_t
Definition stddef.h:38
uint8_t flags
Definition virtio.h:0
unsigned int uint32_t
Definition acefiex.h:163
COMPILER_DEPENDENT_INT64 int64_t
Definition acefiex.h:164
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
#define NULL
Definition actypes.h:561
#define DRM_PROP_NAME_LEN
Definition drm_mode.h:33
#define DRM_MODE_OBJECT_PROPERTY
Definition drm_mode.h:617
#define DRM_MODE_PROP_EXTENDED_TYPE
Definition drm_mode.h:524
struct drm_crtc struct drm_plane struct drm_plane const struct drm_crtc_funcs const char * name
Definition drm_crtc.h:1242
struct drm_mode_object * drm_mode_object_find(struct drm_device *dev, struct drm_file *file_priv, uint32_t id, uint32_t type)
const struct device * dev
Definition drm_print.h:519
struct drm_property_blob * drm_property_lookup_blob(struct drm_device *dev, uint32_t id)
struct drm_property * drm_property_create_bitmask(struct drm_device *dev, u32 flags, const char *name, const struct drm_prop_enum_list *props, int num_props, uint64_t supported_bits)
struct drm_property * drm_property_create(struct drm_device *dev, u32 flags, const char *name, int num_values)
struct drm_property * drm_property_create_range(struct drm_device *dev, u32 flags, const char *name, uint64_t min, uint64_t max)
struct drm_property * drm_property_create_bool(struct drm_device *dev, u32 flags, const char *name)
void drm_property_destroy(struct drm_device *dev, struct drm_property *property)
struct drm_property * drm_property_create_signed_range(struct drm_device *dev, u32 flags, const char *name, int64_t min, int64_t max)
int drm_property_replace_blob_from_id(struct drm_device *dev, struct drm_property_blob **blob, uint64_t blob_id, ssize_t expected_size, ssize_t expected_elem_size, ssize_t max_size, bool *replaced)
int drm_property_replace_global_blob(struct drm_device *dev, struct drm_property_blob **replace, size_t length, const void *data, struct drm_mode_object *obj_holds_id, struct drm_property *prop_holds_id)
bool drm_property_replace_blob(struct drm_property_blob **blob, struct drm_property_blob *new_blob)
struct drm_property * drm_property_create_enum(struct drm_device *dev, u32 flags, const char *name, const struct drm_prop_enum_list *props, int num_values)
void drm_property_blob_put(struct drm_property_blob *blob)
struct drm_property_blob * drm_property_blob_get(struct drm_property_blob *blob)
#define obj_to_property(x)
Definition drm_property.h:230
struct drm_property * drm_property_create_object(struct drm_device *dev, u32 flags, const char *name, uint32_t type)
struct drm_property_blob * drm_property_create_blob(struct drm_device *dev, size_t length, const void *data)
int drm_property_add_enum(struct drm_property *property, uint64_t value, const char *name)
void * data
Definition kthread.h:30
uint32_t u32
Definition kernel.h:16
int const struct list_head const struct list_head struct list_head * head
Definition list_sort.h:13
#define min(a, b)
Definition minmax.h:24
#define max(a, b)
Definition minmax.h:28
Definition drm_device.h:75
Definition drm_file.h:165
Definition drm_mode_object.h:55
Definition drm_property.h:225
int type
Definition drm_property.h:226
const char * name
Definition drm_property.h:227
Definition drm_property.h:216
void * data
Definition drm_property.h:222
struct list_head head_global
Definition drm_property.h:219
struct drm_mode_object base
Definition drm_property.h:217
struct drm_device * dev
Definition drm_property.h:218
size_t length
Definition drm_property.h:221
struct list_head head_file
Definition drm_property.h:220
Definition drm_property.h:40
char name[DRM_PROP_NAME_LEN]
Definition drm_property.h:51
uint64_t value
Definition drm_property.h:49
Definition drm_property.h:80
struct list_head enum_list
Definition drm_property.h:197
struct drm_mode_object base
Definition drm_property.h:89
uint32_t flags
Definition drm_property.h:166
char name[DRM_PROP_NAME_LEN]
Definition drm_property.h:171
struct drm_device * dev
Definition drm_property.h:189
uint64_t * values
Definition drm_property.h:184
uint32_t num_values
Definition drm_property.h:176
Definition list.h:11