[PATCH xrandr] Adding a "--filter" flag

Aaron Plattner aplattner at nvidia.com
Thu Jun 1 20:07:41 UTC 2017


I fixed up a few things from this and pushed it. Can you please update https://patchwork.freedesktop.org/patch/146123/ ?

remote: Updating patchwork state for https://patchwork.freedesktop.org/project/Xorg/list/
remote: E: failed to find patch for rev 6ac2afc0d7d8d51d4085767b901667393c11061b.
remote: I: 0 patch(es) updated to state Accepted.
To git.freedesktop.org:/git/xorg/app/xrandr
   5d5db88d106a..6ac2afc0d7d8  master -> master

On 03/23/2017 04:05 PM, Pablo De La Garza wrote:
> From: pdelagarza <pdelagarza at nvidia.com>
> 
> Flag can be set to "nearest" or "bilinear"
> 
> Signed-off-by: Pablo De La Garza <pdelagarza at nvidia.com>
> ---
>   xrandr.c | 35 +++++++++++++++++++++++++++++++++++
>   1 file changed, 35 insertions(+)
> 
> diff --git a/xrandr.c b/xrandr.c
> index dcfdde0..c2cc82e 100644
> --- a/xrandr.c
> +++ b/xrandr.c
> @@ -54,6 +54,12 @@ static Bool	automatic = False;
>   static Bool	properties = False;
>   static Bool	grab_server = True;
>   static Bool	no_primary = False;
> +static int      filterType = -1;
> +
> +static const char *filterTypeList[2] = {
> +    "bilinear",
> +    "nearest"};
> +
>   
>   static const char *direction[5] = {
>       "normal",
> @@ -118,6 +124,7 @@ usage(void)
>              "  --fb <width>x<height>\n"
>              "  --fbmm <width>x<height>\n"
>              "  --dpi <dpi>/<output>\n"
> +           "  --filter <filterType>,    filterType: nearest, bilinear\n"
>              "  --output <output>\n"
>              "      --auto\n"
>              "      --mode <mode>\n"
> @@ -285,6 +292,7 @@ typedef enum _changes {
>       changes_panning = (1 << 10),
>       changes_gamma = (1 << 11),
>       changes_primary = (1 << 12),
> +    changes_filter = (1 << 13),
>   } changes_t;
>   
>   typedef enum _name_kind {
> @@ -1311,6 +1319,11 @@ set_output_info (output_t *output, RROutput xid, XRROutputInfo *output_info)
>   	    output->transform.params = NULL;
>   	}
>       }
> +    if (output->changes & changes_filter)
> +    {
> +        output->transform.filter = filterTypeList[filterType];
> +    }
> +
>   
>       /* set primary */
>       if (!(output->changes & changes_primary))
> @@ -2808,6 +2821,28 @@ main (int argc, char **argv)
>   	    action_requested = True;
>   	    continue;
>   	}
> +
> +        if (!strcmp("--filter", argv[i]))
> +        {
> +            if (!config_output) argerr ("%s must be used after --output\n", argv[i]);
> +            if (++i >= argc) argerr("%s requires an argument\n", argv[i-1]);
> +
> +            for (int t=0;t < sizeof(filterTypeList)/sizeof(filterTypeList[0]);t++)
> +            {
> +                if (!strcmp(filterTypeList[t],argv[i]))
> +                {
> +                    filterType = t;
> +                    break;
> +                }
> +            }
> +
> +            if (filterType==-1) argerr("Bad argument: %s, for a filter\n", argv[i]);
> +
> +            config_output->changes |= changes_filter;
> +            action_requested = True;
> +            continue;
> +        }
> +
>   	if (!strcmp ("--crtc", argv[i])) {
>   	    if (!config_output) argerr ("%s must be used after --output\n", argv[i]);
>   	    if (++i >= argc) argerr ("%s requires an argument\n", argv[i-1]);
> 


More information about the xorg-devel mailing list