| Message ID | 1490310302-8239-1-git-send-email-pdelagarza@nvidia.com |
|---|---|
| State | Superseded |
| Headers | show |
| Series |
"Adding a "--filter" flag"
( rev:
1
)
in
X.org (DEPRECATED - USE GITLAB) |
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]);
ping :) Thanks, Pablo On Thu, 23 Mar 2017, Pablo De La Garza wrote: > From: pdelagarza <pdelagarza@nvidia.com> > > Flag can be set to "nearest" or "bilinear" > > Signed-off-by: Pablo De La Garza <pdelagarza@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]); > -- > 2.7.4 > >
On Tue, 2017-04-04 at 17:57 -0700, pdelagarza wrote:
> ping :)
There was a more elaborate version of something like this a while back:
https://lists.freedesktop.org/archives/xorg-devel/2016-April/049284.html
- ajax
Hi Adam, Thank you for taking the time to look at my patch. I saw the one you are referring to, but that one for some reason never got integrated. Which one do you prefer? Thanks, Pablo On Mon, 10 Apr 2017, Adam Jackson wrote: > On Tue, 2017-04-04 at 17:57 -0700, pdelagarza wrote: > > ping :) > > There was a more elaborate version of something like this a while back: > > https://lists.freedesktop.org/archives/xorg-devel/2016-April/049284.html > > - ajax >
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@nvidia.com> > > Flag can be set to "nearest" or "bilinear" > > Signed-off-by: Pablo De La Garza <pdelagarza@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]); >