mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
drm: add helpers to go from plane state to drm_rect
Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> [seanpaul resolved conflict in drm_plane.h] Signed-off-by: Sean Paul <seanpaul@chromium.org>
This commit is contained in:
parent
d8187177b0
commit
1638d30c15
4 changed files with 30 additions and 26 deletions
|
@ -118,6 +118,30 @@ struct drm_plane_state {
|
|||
struct drm_atomic_state *state;
|
||||
};
|
||||
|
||||
static inline struct drm_rect
|
||||
drm_plane_state_src(const struct drm_plane_state *state)
|
||||
{
|
||||
struct drm_rect src = {
|
||||
.x1 = state->src_x,
|
||||
.y1 = state->src_y,
|
||||
.x2 = state->src_x + state->src_w,
|
||||
.y2 = state->src_y + state->src_h,
|
||||
};
|
||||
return src;
|
||||
}
|
||||
|
||||
static inline struct drm_rect
|
||||
drm_plane_state_dest(const struct drm_plane_state *state)
|
||||
{
|
||||
struct drm_rect dest = {
|
||||
.x1 = state->crtc_x,
|
||||
.y1 = state->crtc_y,
|
||||
.x2 = state->crtc_x + state->crtc_w,
|
||||
.y2 = state->crtc_y + state->crtc_h,
|
||||
};
|
||||
return dest;
|
||||
}
|
||||
|
||||
/**
|
||||
* struct drm_plane_funcs - driver plane control functions
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue