drm-backend: Cache paint node transform

Instead of calculating this multiple times, just store it in the paint
node.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2023-01-18 15:50:50 -06:00
parent da3d3c7e95
commit e3ec879d11
3 changed files with 9 additions and 4 deletions

View File

@ -677,14 +677,12 @@ drm_head_find_by_connector(struct drm_backend *backend, uint32_t connector_id);
static inline bool
drm_paint_node_transform_supported(struct weston_paint_node *node, struct weston_output *output)
{
enum wl_output_transform wt;
/* if false, the transform doesn't map to any of the standard
* (ie: 90 degree) output transformations. */
if (!weston_matrix_to_transform(&node->buffer_to_output_matrix, &wt))
if (!node->valid_transform)
return false;
if (wt != WL_OUTPUT_TRANSFORM_NORMAL)
if (node->transform != WL_OUTPUT_TRANSFORM_NORMAL)
return false;
return true;

View File

@ -157,9 +157,13 @@ paint_node_update(struct weston_paint_node *pnode)
pnode->output, mat);
weston_matrix_invert(&pnode->output_to_buffer_matrix, mat);
pnode->needs_filtering = weston_matrix_needs_filtering(mat);
pnode->valid_transform = weston_matrix_to_transform(mat,
&pnode->transform);
}
pnode->status = PAINT_NODE_CLEAN;
}
static struct weston_paint_node *

View File

@ -506,6 +506,9 @@ struct weston_paint_node {
struct weston_matrix output_to_buffer_matrix;
bool needs_filtering;
bool valid_transform;
enum wl_output_transform transform;
/* struct weston_output::paint_node_z_order_list */
struct wl_list z_order_link;