mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-17 06:46:39 -04:00
backend/drm: return bool from drm_connector_state_init()
The next commit will need to handle allocation failures from this function.
This commit is contained in:
parent
0db4df4c8e
commit
4939a81ab4
1 changed files with 9 additions and 3 deletions
|
|
@ -628,7 +628,7 @@ static bool drm_commit(struct wlr_drm_backend *drm,
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void drm_connector_state_init(struct wlr_drm_connector_state *state,
|
static bool drm_connector_state_init(struct wlr_drm_connector_state *state,
|
||||||
struct wlr_drm_connector *conn,
|
struct wlr_drm_connector *conn,
|
||||||
const struct wlr_output_state *base) {
|
const struct wlr_output_state *base) {
|
||||||
*state = (struct wlr_drm_connector_state){
|
*state = (struct wlr_drm_connector_state){
|
||||||
|
|
@ -689,6 +689,8 @@ static void drm_connector_state_init(struct wlr_drm_connector_state *state,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void drm_connector_state_finish(struct wlr_drm_connector_state *state) {
|
static void drm_connector_state_finish(struct wlr_drm_connector_state *state) {
|
||||||
|
|
@ -880,7 +882,9 @@ static bool drm_connector_commit_state(struct wlr_drm_connector *conn,
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
struct wlr_drm_connector_state pending = {0};
|
struct wlr_drm_connector_state pending = {0};
|
||||||
drm_connector_state_init(&pending, conn, state);
|
if (!drm_connector_state_init(&pending, conn, state)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
struct wlr_drm_device_state pending_dev = {
|
struct wlr_drm_device_state pending_dev = {
|
||||||
.modeset = state->allow_reconfiguration,
|
.modeset = state->allow_reconfiguration,
|
||||||
// The wlr_output API requires non-modeset commits with a new buffer to
|
// The wlr_output API requires non-modeset commits with a new buffer to
|
||||||
|
|
@ -1987,7 +1991,9 @@ bool commit_drm_device(struct wlr_drm_backend *drm,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_drm_connector_state *conn_state = &conn_states[conn_states_len];
|
struct wlr_drm_connector_state *conn_state = &conn_states[conn_states_len];
|
||||||
drm_connector_state_init(conn_state, conn, &output_state->base);
|
if (!drm_connector_state_init(conn_state, conn, &output_state->base)) {
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
conn_states_len++;
|
conn_states_len++;
|
||||||
|
|
||||||
if (!drm_connector_prepare(conn_state, test_only)) {
|
if (!drm_connector_prepare(conn_state, test_only)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue