Re: [PATCH weston] parse_modeline: Ignore case of {h,v}sync flags

2018-07-03 Thread Guido Günther
Hi,
On Tue, Jul 03, 2018 at 12:04:37PM +0300, Pekka Paalanen wrote:
> On Tue, 26 Jun 2018 20:40:08 +0200
> Guido Günther  wrote:
> 
> > Some modeline generators put out e.g. +HSync instead of +hsync. Accept
> > that too since it's not ambigous.
> > 
> > Signed-off-by: Guido Günther 
> > ---
> >  libweston/compositor-drm.c | 8 
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> > index 8b1ea66d..1c9b7134 100644
> > --- a/libweston/compositor-drm.c
> > +++ b/libweston/compositor-drm.c
> > @@ -4341,16 +4341,16 @@ parse_modeline(const char *s, drmModeModeInfo *mode)
> > return -1;
> >  
> > mode->clock = fclock * 1000;
> > -   if (strcmp(hsync, "+hsync") == 0)
> > +   if (strcasecmp(hsync, "+hsync") == 0)
> > mode->flags |= DRM_MODE_FLAG_PHSYNC;
> > -   else if (strcmp(hsync, "-hsync") == 0)
> > +   else if (strcasecmp(hsync, "-hsync") == 0)
> > mode->flags |= DRM_MODE_FLAG_NHSYNC;
> > else
> > return -1;
> >  
> > -   if (strcmp(vsync, "+vsync") == 0)
> > +   if (strcasecmp(vsync, "+vsync") == 0)
> > mode->flags |= DRM_MODE_FLAG_PVSYNC;
> > -   else if (strcmp(vsync, "-vsync") == 0)
> > +   else if (strcasecmp(vsync, "-vsync") == 0)
> > mode->flags |= DRM_MODE_FLAG_NVSYNC;
> > else
> > return -1;
> 
> Hi,
> 
> I suppose this does no harm. Pushed:

Yeah, that was my intend when sending the patch.

>35280448..92278e08  master -> master


Thanks,
 -- Guido
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] parse_modeline: Ignore case of {h,v}sync flags

2018-07-03 Thread Pekka Paalanen
On Tue, 26 Jun 2018 20:40:08 +0200
Guido Günther  wrote:

> Some modeline generators put out e.g. +HSync instead of +hsync. Accept
> that too since it's not ambigous.
> 
> Signed-off-by: Guido Günther 
> ---
>  libweston/compositor-drm.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index 8b1ea66d..1c9b7134 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -4341,16 +4341,16 @@ parse_modeline(const char *s, drmModeModeInfo *mode)
>   return -1;
>  
>   mode->clock = fclock * 1000;
> - if (strcmp(hsync, "+hsync") == 0)
> + if (strcasecmp(hsync, "+hsync") == 0)
>   mode->flags |= DRM_MODE_FLAG_PHSYNC;
> - else if (strcmp(hsync, "-hsync") == 0)
> + else if (strcasecmp(hsync, "-hsync") == 0)
>   mode->flags |= DRM_MODE_FLAG_NHSYNC;
>   else
>   return -1;
>  
> - if (strcmp(vsync, "+vsync") == 0)
> + if (strcasecmp(vsync, "+vsync") == 0)
>   mode->flags |= DRM_MODE_FLAG_PVSYNC;
> - else if (strcmp(vsync, "-vsync") == 0)
> + else if (strcasecmp(vsync, "-vsync") == 0)
>   mode->flags |= DRM_MODE_FLAG_NVSYNC;
>   else
>   return -1;

Hi,

I suppose this does no harm. Pushed:
   35280448..92278e08  master -> master


Thanks,
pq


pgpVmghQeJVr7.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] parse_modeline: Ignore case of {h,v}sync flags

2018-06-27 Thread Emil Velikov
On 27 June 2018 at 12:42, Guido Günther  wrote:
> Hi,
> On Wed, Jun 27, 2018 at 11:30:40AM +0100, Emil Velikov wrote:
>> On 26 June 2018 at 19:40, Guido Günther  wrote:
>> > Some modeline generators put out e.g. +HSync instead of +hsync. Accept
>> > that too since it's not ambigous.
>> >
>> Hmm which generator is that? The cvt one, given as an example seems to
>> produce lowercase ones.
>
> The xorg.conf manpage uses +HSync and a calculator generating just that is
>
>   https://arachnoid.com/modelines/
>
You are right, xorg.conf does list the camelcase instances. At the
same time nearly anything in that file is case insensitive.

> and I don't see why doing this case insensitive would hurt anyone and
> make things less error prone for users.
Yes it is trivial and more importantly it's not my call to make [as I
mentioned earlier].

Having "modeline" and "less error prone" in the same context is an
interesting oxymoron.
Instead of having a per display server modelines, a more consistent
and robust solution is to utilise the kernel command line [1] or via a
custom edid blob [2].

HTH
Emil

[1] video=... see the format
https://gitlab.freedesktop.org/lima/linux/blob/a01c47737a9ca118ab75c6fd6e75739b824de830/drivers/gpu/drm/drm_modes.c#L1350

[2] drm_kms_helper.edid_firmware=...
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] parse_modeline: Ignore case of {h,v}sync flags

2018-06-27 Thread Guido Günther
Hi,
On Wed, Jun 27, 2018 at 11:30:40AM +0100, Emil Velikov wrote:
> On 26 June 2018 at 19:40, Guido Günther  wrote:
> > Some modeline generators put out e.g. +HSync instead of +hsync. Accept
> > that too since it's not ambigous.
> >
> Hmm which generator is that? The cvt one, given as an example seems to
> produce lowercase ones.

The xorg.conf manpage uses +HSync and a calculator generating just that is

  https://arachnoid.com/modelines/

and I don't see why doing this case insensitive would hurt anyone and
make things less error prone for users.
Cheers,
 -- Guido
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] parse_modeline: Ignore case of {h,v}sync flags

2018-06-27 Thread Emil Velikov
On 26 June 2018 at 19:40, Guido Günther  wrote:
> Some modeline generators put out e.g. +HSync instead of +hsync. Accept
> that too since it's not ambigous.
>
Hmm which generator is that? The cvt one, given as an example seems to
produce lowercase ones.
Personally I'm inclined to suggest fixing the generator or using cvt,
instead of working around it here.

That said, more experienced developers should make the call.

HTH
Emil
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] parse_modeline: Ignore case of {h,v}sync flags

2018-06-26 Thread Guido Günther
Some modeline generators put out e.g. +HSync instead of +hsync. Accept
that too since it's not ambigous.

Signed-off-by: Guido Günther 
---
 libweston/compositor-drm.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 8b1ea66d..1c9b7134 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -4341,16 +4341,16 @@ parse_modeline(const char *s, drmModeModeInfo *mode)
return -1;
 
mode->clock = fclock * 1000;
-   if (strcmp(hsync, "+hsync") == 0)
+   if (strcasecmp(hsync, "+hsync") == 0)
mode->flags |= DRM_MODE_FLAG_PHSYNC;
-   else if (strcmp(hsync, "-hsync") == 0)
+   else if (strcasecmp(hsync, "-hsync") == 0)
mode->flags |= DRM_MODE_FLAG_NHSYNC;
else
return -1;
 
-   if (strcmp(vsync, "+vsync") == 0)
+   if (strcasecmp(vsync, "+vsync") == 0)
mode->flags |= DRM_MODE_FLAG_PVSYNC;
-   else if (strcmp(vsync, "-vsync") == 0)
+   else if (strcasecmp(vsync, "-vsync") == 0)
mode->flags |= DRM_MODE_FLAG_NVSYNC;
else
return -1;
-- 
2.17.1
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel