mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-02 11:55:59 +01:00
Do not allow gamma control without a crtc
This commit is contained in:
parent
ab011406ad
commit
f5e5d1983b
1 changed files with 10 additions and 2 deletions
|
@ -232,15 +232,23 @@ static void wlr_drm_connector_set_gamma(struct wlr_output *output,
|
||||||
uint32_t size, uint16_t *r, uint16_t *g, uint16_t *b) {
|
uint32_t size, uint16_t *r, uint16_t *g, uint16_t *b) {
|
||||||
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
|
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
|
||||||
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
|
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
|
||||||
|
|
||||||
|
if (conn->crtc) {
|
||||||
drm->iface->crtc_set_gamma(drm, conn->crtc, r, g, b, size);
|
drm->iface->crtc_set_gamma(drm, conn->crtc, r, g, b, size);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static uint32_t wlr_drm_connector_get_gamma_size(struct wlr_output *output) {
|
static uint32_t wlr_drm_connector_get_gamma_size(struct wlr_output *output) {
|
||||||
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
|
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
|
||||||
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
|
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
|
||||||
|
|
||||||
|
if (conn->crtc) {
|
||||||
return drm->iface->crtc_get_gamma_size(drm, conn->crtc);
|
return drm->iface->crtc_get_gamma_size(drm, conn->crtc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void wlr_drm_connector_start_renderer(struct wlr_drm_connector *conn) {
|
void wlr_drm_connector_start_renderer(struct wlr_drm_connector *conn) {
|
||||||
if (conn->state != WLR_DRM_CONN_CONNECTED) {
|
if (conn->state != WLR_DRM_CONN_CONNECTED) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue