aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorScott Anderson <ascent12@hotmail.com>2018-10-03 13:16:59 +0200
committerGitHub <noreply@github.com>2018-10-03 13:16:59 +0200
commit43af104fa3939234794da3a15bca102138c3aa70 (patch)
tree35cf165496282f39060f549115863cae8272d9c2 /include
parent1dd523c34c71a7d156c62bc3e3f033113b666e4d (diff)
parente88db9a3fb4208776b2a3ef35fdbd5fa344c0905 (diff)
Merge pull request #1277 from emersion/reset-gamma
backend/drm: reset gamma table on VT switch
Diffstat (limited to 'include')
-rw-r--r--include/backend/drm/drm.h5
-rw-r--r--include/backend/drm/iface.h8
-rw-r--r--include/wlr/interfaces/wlr_output.h6
-rw-r--r--include/wlr/types/wlr_output.h6
4 files changed, 15 insertions, 10 deletions
diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h
index 3b01b64f..3c728808 100644
--- a/include/backend/drm/drm.h
+++ b/include/backend/drm/drm.h
@@ -57,6 +57,9 @@ struct wlr_drm_crtc {
union wlr_drm_crtc_props props;
struct wl_list connectors;
+
+ uint16_t *gamma_table;
+ size_t gamma_table_size;
};
struct wlr_drm_backend {
@@ -151,5 +154,7 @@ void restore_drm_outputs(struct wlr_drm_backend *drm);
void scan_drm_connectors(struct wlr_drm_backend *state);
int handle_drm_event(int fd, uint32_t mask, void *data);
bool enable_drm_connector(struct wlr_output *output, bool enable);
+bool set_drm_connector_gamma(struct wlr_output *output, size_t size,
+ const uint16_t *r, const uint16_t *g, const uint16_t *b);
#endif
diff --git a/include/backend/drm/iface.h b/include/backend/drm/iface.h
index ef0e7bf8..5308b136 100644
--- a/include/backend/drm/iface.h
+++ b/include/backend/drm/iface.h
@@ -28,11 +28,11 @@ struct wlr_drm_interface {
struct wlr_drm_crtc *crtc, int x, int y);
// Set the gamma lut on crtc
bool (*crtc_set_gamma)(struct wlr_drm_backend *drm,
- struct wlr_drm_crtc *crtc, uint16_t *r, uint16_t *g, uint16_t *b,
- uint32_t size);
+ struct wlr_drm_crtc *crtc, size_t size,
+ uint16_t *r, uint16_t *g, uint16_t *b);
// Get the gamma lut size of a crtc
- uint32_t (*crtc_get_gamma_size)(struct wlr_drm_backend *drm,
- struct wlr_drm_crtc *crtc);
+ size_t (*crtc_get_gamma_size)(struct wlr_drm_backend *drm,
+ struct wlr_drm_crtc *crtc);
};
extern const struct wlr_drm_interface atomic_iface;
diff --git a/include/wlr/interfaces/wlr_output.h b/include/wlr/interfaces/wlr_output.h
index 4cbf0d67..bfb3bc9d 100644
--- a/include/wlr/interfaces/wlr_output.h
+++ b/include/wlr/interfaces/wlr_output.h
@@ -28,9 +28,9 @@ struct wlr_output_impl {
void (*destroy)(struct wlr_output *output);
bool (*make_current)(struct wlr_output *output, int *buffer_age);
bool (*swap_buffers)(struct wlr_output *output, pixman_region32_t *damage);
- bool (*set_gamma)(struct wlr_output *output,
- uint32_t size, uint16_t *r, uint16_t *g, uint16_t *b);
- uint32_t (*get_gamma_size)(struct wlr_output *output);
+ bool (*set_gamma)(struct wlr_output *output, size_t size,
+ const uint16_t *r, const uint16_t *g, const uint16_t *b);
+ size_t (*get_gamma_size)(struct wlr_output *output);
bool (*export_dmabuf)(struct wlr_output *output,
struct wlr_dmabuf_attributes *attribs);
};
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h
index ecd4f759..9ede7ab7 100644
--- a/include/wlr/types/wlr_output.h
+++ b/include/wlr/types/wlr_output.h
@@ -182,7 +182,7 @@ void wlr_output_schedule_frame(struct wlr_output *output);
/**
* Returns the maximum length of each gamma ramp, or 0 if unsupported.
*/
-uint32_t wlr_output_get_gamma_size(struct wlr_output *output);
+size_t wlr_output_get_gamma_size(struct wlr_output *output);
/**
* Sets the gamma table for this output. `r`, `g` and `b` are gamma ramps for
* red, green and blue. `size` is the length of the ramps and must not exceed
@@ -190,8 +190,8 @@ uint32_t wlr_output_get_gamma_size(struct wlr_output *output);
*
* Providing zero-sized ramps resets the gamma table.
*/
-bool wlr_output_set_gamma(struct wlr_output *output,
- uint32_t size, uint16_t *r, uint16_t *g, uint16_t *b);
+bool wlr_output_set_gamma(struct wlr_output *output, size_t size,
+ const uint16_t *r, const uint16_t *g, const uint16_t *b);
bool wlr_output_export_dmabuf(struct wlr_output *output,
struct wlr_dmabuf_attributes *attribs);
void wlr_output_set_fullscreen_surface(struct wlr_output *output,