summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo (Sunpeng) Li <sunpeng.li@amd.com>2018-03-27 15:23:29 -0400
committerLeo (Sunpeng) Li <sunpeng.li@amd.com>2018-05-02 10:13:31 -0400
commitbdedf5834b73cde0dafa8fa1aaa22cd4d12002d2 (patch)
tree543c64d37fab25a8dd10518f1c174b9c8451a55b
parent26d8404fb3ea871be9488d31a2e5da0f67df1488 (diff)
Define macros for property names
Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
-rw-r--r--demo.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/demo.c b/demo.c
index 200987e..3b68b7d 100644
--- a/demo.c
+++ b/demo.c
@@ -39,6 +39,10 @@
#define LUT_SIZE 4096
+#define PROP_GAMMA "GAMMA_LUT"
+#define PROP_DEGAMMA "DEGAMMA_LUT"
+#define PROP_CTM "CTM"
+
/**
* The below data structures are identical to the ones used by DRM. They are
* here to help us structure the data being passed to the kernel.
@@ -274,7 +278,7 @@ static int set_gamma(int drm_fd, struct color3d *coeffs, int is_srgb,
* set a NULL blob id (0) */
sprintf(randr_cmd, "xrandr --output DisplayPort-0 --set %s %d",
- is_degamma ? "DEGAMMA_LUT" : "GAMMA_LUT", blob_id);
+ is_degamma ? PROP_DEGAMMA : PROP_GAMMA, blob_id);
printf("# %s\n", randr_cmd);
system(randr_cmd);
@@ -324,8 +328,8 @@ static int set_ctm(int drm_fd, double *coeffs)
}
printf("Created property blob with id %d\n", blob_id);
- sprintf(randr_cmd, "xrandr --output DisplayPort-0 --set CTM %d",
- blob_id);
+ sprintf(randr_cmd, "xrandr --output DisplayPort-0 --set %s %d",
+ PROP_CTM, blob_id);
printf("# %s\n", randr_cmd);
system(randr_cmd);