aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-12-18 20:11:51 +0100
committerMattias Andrée <maandree@kth.se>2016-12-18 20:11:51 +0100
commit8e58eab57831515ed6cf4cc04f55db00d431ef84 (patch)
treed32af7312ea5f8fb81721f856ae681c9adca30b4 /src
parentcg-base: add filters_n (diff)
downloadcg-tools-8e58eab57831515ed6cf4cc04f55db00d431ef84.tar.gz
cg-tools-8e58eab57831515ed6cf4cc04f55db00d431ef84.tar.bz2
cg-tools-8e58eab57831515ed6cf4cc04f55db00d431ef84.tar.xz
struct filter_update: add crtc
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src')
-rw-r--r--src/cg-base.c1
-rw-r--r--src/cg-base.h5
-rw-r--r--src/cg-brilliance.c2
-rw-r--r--src/cg-darkroom.c2
-rw-r--r--src/cg-gamma.c4
-rw-r--r--src/cg-limits.c4
-rw-r--r--src/cg-negative.c2
-rw-r--r--src/cg-rainbow.c2
-rw-r--r--src/cg-sleepmode.c4
9 files changed, 16 insertions, 10 deletions
diff --git a/src/cg-base.c b/src/cg-base.c
index c0abf47..c8ed045 100644
--- a/src/cg-base.c
+++ b/src/cg-base.c
@@ -780,6 +780,7 @@ int main(int argc, char* argv[])
goto fail;
if (libcoopgamma_error_initialise(&(crtc_updates[crtcs_i].error)) < 0)
goto fail;
+ crtc_updates[crtcs_i].crtc = crtcs_i;
crtc_updates[crtcs_i].synced = 1;
crtc_updates[crtcs_i].failed = 0;
crtc_updates[crtcs_i].master = 1;
diff --git a/src/cg-base.h b/src/cg-base.h
index f4beed1..0b3f497 100644
--- a/src/cg-base.h
+++ b/src/cg-base.h
@@ -68,6 +68,11 @@ typedef struct filter_update
libcoopgamma_filter_t filter;
/**
+ * The index of the CRTC
+ */
+ size_t crtc;
+
+ /**
* Has the update been synchronised?
*/
int synced;
diff --git a/src/cg-brilliance.c b/src/cg-brilliance.c
index 05b8a5c..c948014 100644
--- a/src/cg-brilliance.c
+++ b/src/cg-brilliance.c
@@ -263,7 +263,7 @@ int start(void)
for (i = 0, r = 1; i < filters_n; i++)
{
- if (!(crtc_updates[i].master) || !(crtc_info[i].supported))
+ if (!(crtc_updates[i].master) || !(crtc_info[crtc_updates[i].crtc].supported))
continue;
if (!xflag)
fill_filter(&(crtc_updates[i].filter));
diff --git a/src/cg-darkroom.c b/src/cg-darkroom.c
index 06655e6..0c07b7d 100644
--- a/src/cg-darkroom.c
+++ b/src/cg-darkroom.c
@@ -265,7 +265,7 @@ int start(void)
for (i = 0, r = 1; i < filters_n; i++)
{
- if (!(crtc_updates[i].master) || !(crtc_info[i].supported))
+ if (!(crtc_updates[i].master) || !(crtc_info[crtc_updates[i].crtc].supported))
continue;
if (!xflag)
if ((r = fill_filter(&(crtc_updates[i].filter))) < 0)
diff --git a/src/cg-gamma.c b/src/cg-gamma.c
index 7a51ba0..27e8433 100644
--- a/src/cg-gamma.c
+++ b/src/cg-gamma.c
@@ -476,7 +476,7 @@ int start(void)
if (names == NULL)
for (i = 0, r = 1; i < filters_n; i++)
{
- if (!(crtc_updates[i].master) || !(crtc_info[i].supported))
+ if (!(crtc_updates[i].master) || !(crtc_info[crtc_updates[i].crtc].supported))
continue;
if (!xflag)
fill_filter(&(crtc_updates[i].filter), rgamma, ggamma, bgamma);
@@ -494,7 +494,7 @@ int start(void)
else
for (i = 0, r = 1; i < filters_n; i++)
{
- if (!(crtc_info[i].supported))
+ if (!(crtc_info[crtc_updates[i].crtc].supported))
continue;
for (j = 0; names[j] != NULL; j++)
if (!strcasecmp(crtc_updates[i].filter.crtc, names[j]))
diff --git a/src/cg-limits.c b/src/cg-limits.c
index 2e342e9..5d9b05a 100644
--- a/src/cg-limits.c
+++ b/src/cg-limits.c
@@ -649,7 +649,7 @@ int start(void)
if ((brightness_names == NULL) && (contrast_names == NULL))
for (i = 0, r = 1; i < filters_n; i++)
{
- if (!(crtc_updates[i].master) || !(crtc_info[i].supported))
+ if (!(crtc_updates[i].master) || !(crtc_info[crtc_updates[i].crtc].supported))
continue;
if (!xflag)
if ((r = fill_filter(&(crtc_updates[i].filter), rbrightness, rcontrast,
@@ -673,7 +673,7 @@ int start(void)
char** cnames = contrast_names ? contrast_names : &empty;
for (i = 0, r = 1; i < filters_n; i++)
{
- if (!(crtc_info[i].supported))
+ if (!(crtc_info[crtc_updates[i].crtc].supported))
continue;
for (j = 0; bnames[j] != NULL; j++)
if (!strcasecmp(crtc_updates[i].filter.crtc, bnames[j]))
diff --git a/src/cg-negative.c b/src/cg-negative.c
index a16695a..836a876 100644
--- a/src/cg-negative.c
+++ b/src/cg-negative.c
@@ -205,7 +205,7 @@ int start(void)
for (i = 0, r = 1; i < filters_n; i++)
{
- if (!(crtc_updates[i].master) || !(crtc_info[i].supported))
+ if (!(crtc_updates[i].master) || !(crtc_info[crtc_updates[i].crtc].supported))
continue;
if (!xflag)
fill_filter(&(crtc_updates[i].filter));
diff --git a/src/cg-rainbow.c b/src/cg-rainbow.c
index f6e6460..8cb5871 100644
--- a/src/cg-rainbow.c
+++ b/src/cg-rainbow.c
@@ -249,7 +249,7 @@ int start(void)
for (i = 0, r = 1; i < filters_n; i++)
{
- if (!(crtc_updates[i].master) || !(crtc_info[i].supported))
+ if (!(crtc_updates[i].master) || !(crtc_info[crtc_updates[i].crtc].supported))
continue;
fill_filter(&(crtc_updates[i].filter), pal[0], pal[1], pal[2]);
r = update_filter(i, 0);
diff --git a/src/cg-sleepmode.c b/src/cg-sleepmode.c
index dd6f3e5..9c1fbf7 100644
--- a/src/cg-sleepmode.c
+++ b/src/cg-sleepmode.c
@@ -321,7 +321,7 @@ int start(void)
for (i = 0, r = 1; i < filters_n; i++)
{
- if (!(crtc_updates[i].master) || !(crtc_info[i].supported))
+ if (!(crtc_updates[i].master) || !(crtc_info[crtc_updates[i].crtc].supported))
continue;
fill_filter(&(crtc_updates[i].filter), red, green, blue);
r = update_filter(i, 0);
@@ -421,7 +421,7 @@ int start(void)
for (i = 0, r = 1; i < filters_n; i++)
{
- if (!(crtc_updates[i].master) || !(crtc_info[i].supported))
+ if (!(crtc_updates[i].master) || !(crtc_info[crtc_updates[i].crtc].supported))
continue;
fill_filter(&(crtc_updates[i].filter), red, green, blue);
r = update_filter(i, 0);