mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
drm: mali-dp: Check more use cases in the plane's ->atomic_check()
Mali DP's plane ->atomic_check() only checks for the new state submitting frame buffers with supported pixel formats and if there is enough rotation memory for rotated planes. Add a call to drm_plane_helper_check_state() to add additional checks for plane state validity and clipping issues. Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
This commit is contained in:
parent
cf4c887084
commit
b9c3315c57
1 changed files with 14 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <drm/drmP.h>
|
#include <drm/drmP.h>
|
||||||
|
#include <drm/drm_atomic.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_fb_cma_helper.h>
|
#include <drm/drm_fb_cma_helper.h>
|
||||||
#include <drm/drm_gem_cma_helper.h>
|
#include <drm/drm_gem_cma_helper.h>
|
||||||
|
@ -103,8 +104,10 @@ static int malidp_de_plane_check(struct drm_plane *plane,
|
||||||
{
|
{
|
||||||
struct malidp_plane *mp = to_malidp_plane(plane);
|
struct malidp_plane *mp = to_malidp_plane(plane);
|
||||||
struct malidp_plane_state *ms = to_malidp_plane_state(state);
|
struct malidp_plane_state *ms = to_malidp_plane_state(state);
|
||||||
|
struct drm_crtc_state *crtc_state;
|
||||||
struct drm_framebuffer *fb;
|
struct drm_framebuffer *fb;
|
||||||
int i;
|
struct drm_rect clip = { 0 };
|
||||||
|
int i, ret;
|
||||||
u32 src_w, src_h;
|
u32 src_w, src_h;
|
||||||
|
|
||||||
if (!state->crtc || !state->fb)
|
if (!state->crtc || !state->fb)
|
||||||
|
@ -142,6 +145,16 @@ static int malidp_de_plane_check(struct drm_plane *plane,
|
||||||
fb->format->format == DRM_FORMAT_BGR888))
|
fb->format->format == DRM_FORMAT_BGR888))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
crtc_state = drm_atomic_get_existing_crtc_state(state->state, state->crtc);
|
||||||
|
clip.x2 = crtc_state->adjusted_mode.hdisplay;
|
||||||
|
clip.y2 = crtc_state->adjusted_mode.vdisplay;
|
||||||
|
ret = drm_plane_helper_check_state(state, &clip,
|
||||||
|
DRM_PLANE_HELPER_NO_SCALING,
|
||||||
|
DRM_PLANE_HELPER_NO_SCALING,
|
||||||
|
true, true);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
ms->rotmem_size = 0;
|
ms->rotmem_size = 0;
|
||||||
if (state->rotation & MALIDP_ROTATED_MASK) {
|
if (state->rotation & MALIDP_ROTATED_MASK) {
|
||||||
int val;
|
int val;
|
||||||
|
|
Loading…
Add table
Reference in a new issue