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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26 August 2015 at 07:21, Hyungwon Hwang <human.hwang@xxxxxxxxxxx> 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@xxxxxxxxxxx>
> ---
>  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
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux