[PATCH 1/3] modetest: introduce get_prop_info() for getting property id and type

Emil Velikov emil.l.velikov at gmail.com
Tue Sep 1 16:41:19 PDT 2015


On 26 August 2015 at 07:21, Hyungwon Hwang <human.hwang at samsung.com> wrote:
> Modetest gets the property name from user to set it. So the name must be
> converted to its id. Until now, this is done in the set_property(). But to
> support atomic modeset in modetest, this logic should be separated from the
> fuction, because atomic modeset and legacy modeset use different IOCTLs.
>
> Signed-off-by: Hyungwon Hwang <human.hwang at samsung.com>
> ---
>  tests/modetest/modetest.c | 31 +++++++++++++++++++++----------
>  1 file changed, 21 insertions(+), 10 deletions(-)
>
> diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
> index 43bd06f..b7f6d32 100644
> --- a/tests/modetest/modetest.c
> +++ b/tests/modetest/modetest.c
> @@ -866,12 +866,11 @@ struct property_arg {
>         uint64_t value;
>  };
>
> -static void set_property(struct device *dev, struct property_arg *p)
> +static int get_prop_info(struct resources *resources, struct property_arg *p,
> +                                                               char *obj_type)
Strictly speaking you don't need the struct device > struct resources
change here.
But if you prefer doing so, keep the const qualifier for obj_type.

>  {
>         drmModeObjectProperties *props = NULL;
>         drmModePropertyRes **props_info = NULL;
> -       const char *obj_type;
> -       int ret;
>         int i;
>
...

> +static void set_property(struct device *dev, struct property_arg *p)
> +{
> +       int ret;
> +       char *obj_type = NULL;
> +
Drop the initializer and constify.

-Emil


More information about the dri-devel mailing list