From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 1/2] drm: Don't allow page flip to change pixel format Date: Fri, 1 Jun 2012 14:46:11 +0300 Message-ID: <20120601114611.GU13065@intel.com> References: <1338481576-29751-1-git-send-email-laurent.pinchart@ideasonboard.com> <1338481576-29751-2-git-send-email-laurent.pinchart@ideasonboard.com> <95427A2E42F76A40B7520C17720417F00F3500FC@FMSMSX102.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id A9AC6A0A41 for ; Fri, 1 Jun 2012 04:46:14 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Alex Deucher Cc: "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org On Thu, May 31, 2012 at 03:54:03PM -0400, Alex Deucher wrote: > On Thu, May 31, 2012 at 3:44 PM, Singh, Satyeshwar > wrote: > > Does this by extension mean that stride changes should also not be allo= wed while page flipping? > = > Everything beyond a crtc base address change should require a full modese= t. That's a rather silly limitation on decent hardware, but perhaps it makes sense with the current API. My recent patch for i915 just rejected pixel format, pitch and offset changes on the driver side. The hardware can actually handle such things, except currently the driver uses pipelined flips instead of direct register banging, which imposes these limitations. For the atomic mode setting API I don't plan to special case page flips in generic code at all. I'll leave it up to the driver to decide what operations it can perform atomically and/or asynchronously. > > -----Original Message----- > > From: dri-devel-bounces+satyeshwar.singh=3Dintel.com@lists.freedesktop.= org [mailto:dri-devel-bounces+satyeshwar.singh=3Dintel.com@lists.freedeskto= p.org] On Behalf Of Laurent Pinchart > > Sent: Thursday, May 31, 2012 9:26 AM > > To: dri-devel@lists.freedesktop.org > > Subject: [PATCH 1/2] drm: Don't allow page flip to change pixel format > > > > A page flip is not a mode set, changing the frame buffer pixel format d= oesn't make sense and isn't handled by most drivers anyway. Disallow it. > > > > Signed-off-by: Laurent Pinchart > > --- > > =A0drivers/gpu/drm/drm_crtc.c | =A0 =A08 ++++++++ > > =A01 files changed, 8 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c in= dex 92cea9d..0d15b56 100644 > > --- a/drivers/gpu/drm/drm_crtc.c > > +++ b/drivers/gpu/drm/drm_crtc.c > > @@ -3530,6 +3530,14 @@ int drm_mode_page_flip_ioctl(struct drm_device *= dev, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out; > > =A0 =A0 =A0 =A0} > > > > + =A0 =A0 =A0 if (crtc->fb->pixel_format !=3D fb->pixel_format || > > + =A0 =A0 =A0 =A0 =A0 crtc->fb->bits_per_pixel !=3D crtc->fb->bits_per_= pixel || > > + =A0 =A0 =A0 =A0 =A0 crtc->fb->depth !=3D fb->depth) { The bits_per_pixel and depth comparisons are pointless. I'm thinking we should perhaps just remove them from the structure, so that drivers would be forced to actually use pixel_format. I'm not sure if all the drivers have already been fixed to actually check the requested pixel_format or not, or can you ask for example RGBA8888 and have the hardware scan it out as ARGB8888 instead. -- = Ville Syrj=E4l=E4 Intel OTC