mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 11:40:12 +01:00
Merge branch 'redshift-broken' into 'master'
Revert "xfree86: modesetting: don't use VLA" Closes #1854 See merge request xorg/xserver!2105
This commit is contained in:
commit
c3f3283ef9
2 changed files with 5 additions and 11 deletions
|
|
@ -1911,9 +1911,9 @@ drmmode_set_gamma_lut(drmmode_crtc_private_ptr drmmode_crtc,
|
||||||
drmmode_prop_info_ptr gamma_lut_info =
|
drmmode_prop_info_ptr gamma_lut_info =
|
||||||
&drmmode_crtc->props[DRMMODE_CRTC_GAMMA_LUT];
|
&drmmode_crtc->props[DRMMODE_CRTC_GAMMA_LUT];
|
||||||
const uint32_t crtc_id = drmmode_crtc->mode_crtc->crtc_id;
|
const uint32_t crtc_id = drmmode_crtc->mode_crtc->crtc_id;
|
||||||
struct drm_color_lut *lut = calloc(size, sizeof(struct drm_color_lut));
|
uint32_t blob_id;
|
||||||
if (!lut)
|
assert(size > 0);
|
||||||
return;
|
struct drm_color_lut lut[size];
|
||||||
|
|
||||||
assert(gamma_lut_info->prop_id != 0);
|
assert(gamma_lut_info->prop_id != 0);
|
||||||
|
|
||||||
|
|
@ -1924,17 +1924,13 @@ drmmode_set_gamma_lut(drmmode_crtc_private_ptr drmmode_crtc,
|
||||||
lut[i].reserved = 0;
|
lut[i].reserved = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t blob_id;
|
if (drmModeCreatePropertyBlob(drmmode->fd, lut, size * sizeof(struct drm_color_lut), &blob_id))
|
||||||
if (drmModeCreatePropertyBlob(drmmode->fd, lut, sizeof(lut), &blob_id)) {
|
|
||||||
free(lut);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
drmModeObjectSetProperty(drmmode->fd, crtc_id, DRM_MODE_OBJECT_CRTC,
|
drmModeObjectSetProperty(drmmode->fd, crtc_id, DRM_MODE_OBJECT_CRTC,
|
||||||
gamma_lut_info->prop_id, blob_id);
|
gamma_lut_info->prop_id, blob_id);
|
||||||
|
|
||||||
drmModeDestroyPropertyBlob(drmmode->fd, blob_id);
|
drmModeDestroyPropertyBlob(drmmode->fd, blob_id);
|
||||||
free(lut);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ cc = meson.get_compiler('c')
|
||||||
|
|
||||||
add_project_arguments('-fno-strict-aliasing', language : 'c')
|
add_project_arguments('-fno-strict-aliasing', language : 'c')
|
||||||
add_project_arguments('-fvisibility=hidden', language : 'c')
|
add_project_arguments('-fvisibility=hidden', language : 'c')
|
||||||
add_project_arguments('-Wvla', language: 'c')
|
|
||||||
|
|
||||||
add_project_link_arguments('-fvisibility=hidden', language : 'c')
|
add_project_link_arguments('-fvisibility=hidden', language : 'c')
|
||||||
|
|
||||||
|
|
@ -46,8 +45,7 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
|
||||||
'-Werror=write-strings',
|
'-Werror=write-strings',
|
||||||
'-Werror=address',
|
'-Werror=address',
|
||||||
'-Werror=int-to-pointer-cast',
|
'-Werror=int-to-pointer-cast',
|
||||||
'-Werror=pointer-to-int-cast',
|
'-Werror=pointer-to-int-cast'
|
||||||
'-Wvla',
|
|
||||||
]
|
]
|
||||||
else
|
else
|
||||||
test_wflags = []
|
test_wflags = []
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue