summaryrefslogtreecommitdiffstats
path: root/src/blueshift_randr.pyx
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-05 19:51:20 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-05 19:51:20 +0200
commit3b54aa6b6b0baa8d30ddd6290ad43ef42e745968 (patch)
treeafc40a5244a2023fb531b2cebb2d7d4f6d48c534 /src/blueshift_randr.pyx
parentremove crtc parameter from C and Cython functions for VidMode (diff)
downloadblueshift-3b54aa6b6b0baa8d30ddd6290ad43ef42e745968.tar.gz
blueshift-3b54aa6b6b0baa8d30ddd6290ad43ef42e745968.tar.bz2
blueshift-3b54aa6b6b0baa8d30ddd6290ad43ef42e745968.tar.xz
support more than 64 monitors with randr
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/blueshift_randr.pyx33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/blueshift_randr.pyx b/src/blueshift_randr.pyx
index de6c54f..7de1d13 100644
--- a/src/blueshift_randr.pyx
+++ b/src/blueshift_randr.pyx
@@ -40,16 +40,15 @@ Gets the current colour curves
needs to be free:d. `NULL` on error.
'''
-cdef extern int blueshift_randr_apply(unsigned long long int use_crtcs,
- uint16_t* r_curve, uint16_t* g_curve, uint16_t* b_curve)
+cdef extern int blueshift_randr_apply(int use_crtc, uint16_t* r_curve, uint16_t* g_curve, uint16_t* b_curve)
'''
Apply stage of colour curve control
-@param use_crtcs Mask of CRTC:s to use
-@param r_curve The red colour curve
-@param g_curve The green colour curve
-@param b_curve The blue colour curve
-@return Zero on success
+@param use_crtc The CRTC to use, -1 for all
+@param r_curve The red colour curve
+@param g_curve The green colour curve
+@param b_curve The blue colour curve
+@return Zero on success
'''
cdef extern void blueshift_randr_close()
@@ -126,23 +125,27 @@ def randr_read(int use_crtc):
return (r, g, b)
-def randr_apply(unsigned long long use_crtcs, r_curve, g_curve, b_curve):
+def randr_apply(crtc_indices, r_curve, g_curve, b_curve):
'''
Apply stage of colour curve control
- @param use_crtcs Mask of CRTC:s to use
- @param r_curve:list<int> The red colour curve
- @param g_curve:list<int> The green colour curve
- @param b_curve:list<int> The blue colour curve
- @return Zero on success
+ @param crtc_indices:list<int> The indices of the CRTC:s to control, -1 for all
+ @param r_curve:list<int> The red colour curve
+ @param g_curve:list<int> The green colour curve
+ @param b_curve:list<int> The blue colour curve
+ @return Zero on success
'''
# Convert curves to 16-bit C integers
for i in range(256):
r_c[i] = r_curve[i] & 0xFFFF
g_c[i] = g_curve[i] & 0xFFFF
b_c[i] = b_curve[i] & 0xFFFF
- # Apply curves
- return blueshift_randr_apply(use_crtcs, r_c, g_c, b_c)
+ rc = 0
+ # For each selected CRTC,
+ for crtc_index in crtc_indices:
+ # apply curves.
+ rc |= blueshift_randr_apply(crtc_index, r_c, g_c, b_c)
+ return rc
def randr_close():