From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752380AbbJWLZD (ORCPT ); Fri, 23 Oct 2015 07:25:03 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:33285 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbbJWLZA (ORCPT ); Fri, 23 Oct 2015 07:25:00 -0400 Date: Fri, 23 Oct 2015 13:24:56 +0200 From: Daniel Vetter To: Eric Anholt Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/6] drm/vc4: Make sure that planes aren't scaled. Message-ID: <20151023112456.GO16848@phenom.ffwll.local> Mail-Followup-To: Eric Anholt , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <1445596356-28202-1-git-send-email-eric@anholt.net> <1445596356-28202-6-git-send-email-eric@anholt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1445596356-28202-6-git-send-email-eric@anholt.net> X-Operating-System: Linux phenom 4.1.0-2-amd64 User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 23, 2015 at 11:32:35AM +0100, Eric Anholt wrote: > We would scan out the memory around them if an upscale was attempted, > and would just scan out incorrectly for downscaling. > > Signed-off-by: Eric Anholt > --- > > It looks like, while modetest only wants to set scaling on overlay > planes, one could do so on our primary/cursor planes if the fd was in > universal planes mode. > > drivers/gpu/drm/vc4/vc4_plane.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c > index 2db5092..887f3ca 100644 > --- a/drivers/gpu/drm/vc4/vc4_plane.c > +++ b/drivers/gpu/drm/vc4/vc4_plane.c > @@ -157,6 +157,16 @@ static int vc4_plane_mode_set(struct drm_plane *plane, > int crtc_w = state->crtc_w; > int crtc_h = state->crtc_h; > > + if (state->crtc_w << 16 != state->src_w || > + state->crtc_h << 16 != state->src_h) { > + /* We don't support scaling yet, which involves > + * allocating the LBM memory for scaling temporary > + * storage, and putting filter kernels in the HVS > + * context. > + */ > + return -EINVAL; > + } Just aside: There's drm_plane_helper_check_update for the common cases. Unfortunately it suffers a bit from a bikeshed since it wants struct drm_rect but atomic states don't give you that. -Daniel > + > if (crtc_x < 0) { > offset += drm_format_plane_cpp(fb->pixel_format, 0) * -crtc_x; > crtc_w += crtc_x; > -- > 2.6.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch