Commit 51abc976 authored by Ville Syrjälä's avatar Ville Syrjälä

drm: Make property flags u32

The property flags are part of the uabi and we have 32 bits for them.
Pass them around as u32 internally as well, instead of a signed int.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180306164849.2862-5-ville.syrjala@linux.intel.comReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 147ccf93
...@@ -72,8 +72,9 @@ static bool drm_property_type_valid(struct drm_property *property) ...@@ -72,8 +72,9 @@ static bool drm_property_type_valid(struct drm_property *property)
* Returns: * Returns:
* A pointer to the newly created property on success, NULL on failure. * A pointer to the newly created property on success, NULL on failure.
*/ */
struct drm_property *drm_property_create(struct drm_device *dev, int flags, struct drm_property *drm_property_create(struct drm_device *dev,
const char *name, int num_values) u32 flags, const char *name,
int num_values)
{ {
struct drm_property *property = NULL; struct drm_property *property = NULL;
int ret; int ret;
...@@ -136,10 +137,10 @@ EXPORT_SYMBOL(drm_property_create); ...@@ -136,10 +137,10 @@ EXPORT_SYMBOL(drm_property_create);
* Returns: * Returns:
* A pointer to the newly created property on success, NULL on failure. * A pointer to the newly created property on success, NULL on failure.
*/ */
struct drm_property *drm_property_create_enum(struct drm_device *dev, int flags, struct drm_property *drm_property_create_enum(struct drm_device *dev,
const char *name, u32 flags, const char *name,
const struct drm_prop_enum_list *props, const struct drm_prop_enum_list *props,
int num_values) int num_values)
{ {
struct drm_property *property; struct drm_property *property;
int i, ret; int i, ret;
...@@ -185,10 +186,10 @@ EXPORT_SYMBOL(drm_property_create_enum); ...@@ -185,10 +186,10 @@ EXPORT_SYMBOL(drm_property_create_enum);
* A pointer to the newly created property on success, NULL on failure. * A pointer to the newly created property on success, NULL on failure.
*/ */
struct drm_property *drm_property_create_bitmask(struct drm_device *dev, struct drm_property *drm_property_create_bitmask(struct drm_device *dev,
int flags, const char *name, u32 flags, const char *name,
const struct drm_prop_enum_list *props, const struct drm_prop_enum_list *props,
int num_props, int num_props,
uint64_t supported_bits) uint64_t supported_bits)
{ {
struct drm_property *property; struct drm_property *property;
int i, ret, index = 0; int i, ret, index = 0;
...@@ -222,8 +223,8 @@ struct drm_property *drm_property_create_bitmask(struct drm_device *dev, ...@@ -222,8 +223,8 @@ struct drm_property *drm_property_create_bitmask(struct drm_device *dev,
EXPORT_SYMBOL(drm_property_create_bitmask); EXPORT_SYMBOL(drm_property_create_bitmask);
static struct drm_property *property_create_range(struct drm_device *dev, static struct drm_property *property_create_range(struct drm_device *dev,
int flags, const char *name, u32 flags, const char *name,
uint64_t min, uint64_t max) uint64_t min, uint64_t max)
{ {
struct drm_property *property; struct drm_property *property;
...@@ -256,9 +257,9 @@ static struct drm_property *property_create_range(struct drm_device *dev, ...@@ -256,9 +257,9 @@ static struct drm_property *property_create_range(struct drm_device *dev,
* Returns: * Returns:
* A pointer to the newly created property on success, NULL on failure. * A pointer to the newly created property on success, NULL on failure.
*/ */
struct drm_property *drm_property_create_range(struct drm_device *dev, int flags, struct drm_property *drm_property_create_range(struct drm_device *dev,
const char *name, u32 flags, const char *name,
uint64_t min, uint64_t max) uint64_t min, uint64_t max)
{ {
return property_create_range(dev, DRM_MODE_PROP_RANGE | flags, return property_create_range(dev, DRM_MODE_PROP_RANGE | flags,
name, min, max); name, min, max);
...@@ -285,8 +286,8 @@ EXPORT_SYMBOL(drm_property_create_range); ...@@ -285,8 +286,8 @@ EXPORT_SYMBOL(drm_property_create_range);
* A pointer to the newly created property on success, NULL on failure. * A pointer to the newly created property on success, NULL on failure.
*/ */
struct drm_property *drm_property_create_signed_range(struct drm_device *dev, struct drm_property *drm_property_create_signed_range(struct drm_device *dev,
int flags, const char *name, u32 flags, const char *name,
int64_t min, int64_t max) int64_t min, int64_t max)
{ {
return property_create_range(dev, DRM_MODE_PROP_SIGNED_RANGE | flags, return property_create_range(dev, DRM_MODE_PROP_SIGNED_RANGE | flags,
name, I642U64(min), I642U64(max)); name, I642U64(min), I642U64(max));
...@@ -312,7 +313,7 @@ EXPORT_SYMBOL(drm_property_create_signed_range); ...@@ -312,7 +313,7 @@ EXPORT_SYMBOL(drm_property_create_signed_range);
* A pointer to the newly created property on success, NULL on failure. * A pointer to the newly created property on success, NULL on failure.
*/ */
struct drm_property *drm_property_create_object(struct drm_device *dev, struct drm_property *drm_property_create_object(struct drm_device *dev,
int flags, const char *name, u32 flags, const char *name,
uint32_t type) uint32_t type)
{ {
struct drm_property *property; struct drm_property *property;
...@@ -348,8 +349,8 @@ EXPORT_SYMBOL(drm_property_create_object); ...@@ -348,8 +349,8 @@ EXPORT_SYMBOL(drm_property_create_object);
* Returns: * Returns:
* A pointer to the newly created property on success, NULL on failure. * A pointer to the newly created property on success, NULL on failure.
*/ */
struct drm_property *drm_property_create_bool(struct drm_device *dev, int flags, struct drm_property *drm_property_create_bool(struct drm_device *dev,
const char *name) u32 flags, const char *name)
{ {
return drm_property_create_range(dev, flags, name, 0, 1); return drm_property_create_range(dev, flags, name, 0, 1);
} }
......
...@@ -237,27 +237,29 @@ static inline bool drm_property_type_is(struct drm_property *property, ...@@ -237,27 +237,29 @@ static inline bool drm_property_type_is(struct drm_property *property,
return property->flags & type; return property->flags & type;
} }
struct drm_property *drm_property_create(struct drm_device *dev, int flags, struct drm_property *drm_property_create(struct drm_device *dev,
const char *name, int num_values); u32 flags, const char *name,
struct drm_property *drm_property_create_enum(struct drm_device *dev, int flags, int num_values);
const char *name, struct drm_property *drm_property_create_enum(struct drm_device *dev,
u32 flags, const char *name,
const struct drm_prop_enum_list *props, const struct drm_prop_enum_list *props,
int num_values); int num_values);
struct drm_property *drm_property_create_bitmask(struct drm_device *dev, struct drm_property *drm_property_create_bitmask(struct drm_device *dev,
int flags, const char *name, u32 flags, const char *name,
const struct drm_prop_enum_list *props, const struct drm_prop_enum_list *props,
int num_props, int num_props,
uint64_t supported_bits); uint64_t supported_bits);
struct drm_property *drm_property_create_range(struct drm_device *dev, int flags, struct drm_property *drm_property_create_range(struct drm_device *dev,
const char *name, u32 flags, const char *name,
uint64_t min, uint64_t max); uint64_t min, uint64_t max);
struct drm_property *drm_property_create_signed_range(struct drm_device *dev, struct drm_property *drm_property_create_signed_range(struct drm_device *dev,
int flags, const char *name, u32 flags, const char *name,
int64_t min, int64_t max); int64_t min, int64_t max);
struct drm_property *drm_property_create_object(struct drm_device *dev, struct drm_property *drm_property_create_object(struct drm_device *dev,
int flags, const char *name, uint32_t type); u32 flags, const char *name,
struct drm_property *drm_property_create_bool(struct drm_device *dev, int flags, uint32_t type);
const char *name); struct drm_property *drm_property_create_bool(struct drm_device *dev,
u32 flags, const char *name);
int drm_property_add_enum(struct drm_property *property, int index, int drm_property_add_enum(struct drm_property *property, int index,
uint64_t value, const char *name); uint64_t value, const char *name);
void drm_property_destroy(struct drm_device *dev, struct drm_property *property); void drm_property_destroy(struct drm_device *dev, struct drm_property *property);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment