mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-04-27 14:10:45 +02:00
backend-drm: Do not create a head for invalid blacklight values
This most likely is a driver fail, as we shouldn't be getting a zero value for max_brightness. Later on, this will be used to compute a normalized brightness which would trip a with a division by zero. Rather than fixing that up, just don't enable backlight support and reportat that to the user that we have an invalid max_brightness value and not backlight support. Fixes: #878 Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
parent
08c7015a32
commit
a7dad91d8f
1 changed files with 7 additions and 0 deletions
|
|
@ -2715,6 +2715,13 @@ drm_head_create(struct drm_device *device, drmModeConnector *conn,
|
|||
goto err_update;
|
||||
|
||||
head->backlight = backlight_init(drm_device, conn->connector_type);
|
||||
if (head->backlight && head->backlight->max_brightness == 0) {
|
||||
weston_log("Failed to retreive a valid value for max_brightness"
|
||||
" from connector %d. Backlight disabled\n",
|
||||
head->connector.connector_id);
|
||||
backlight_destroy(head->backlight);
|
||||
head->backlight = NULL;
|
||||
}
|
||||
|
||||
if (conn->connector_type == DRM_MODE_CONNECTOR_LVDS ||
|
||||
conn->connector_type == DRM_MODE_CONNECTOR_eDP)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue