From: Ilija Hadzic Subject: Re: [PATCH] kernel/drm: vblank wait on crtc > 1 Date: Sun, 20 Mar 2011 12:32:49 -0500 (CDT) Message-ID: References: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-851401618-1300642307=:20979" Return-path: Received: from ihemail4.lucent.com (ihemail4.lucent.com [135.245.0.39]) by gabe.freedesktop.org (Postfix) with ESMTP id 783899E75C for ; Sun, 20 Mar 2011 10:32:53 -0700 (PDT) In-Reply-To: Content-ID: 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 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---559023410-851401618-1300642307=:20979 Content-Type: TEXT/PLAIN; CHARSET=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: On Sat, 19 Mar 2011, Alex Deucher wrote: > On Fri, Mar 18, 2011 at 5:58 PM, Ilija Hadzic > wrote: >> >> Hi Dave, >> >> Below is a patch against drm-next branch of 2.6.38-rc8+ kernel that adds= the >> capability to wait on vblank events for CRTCs that are greater than 1 an= d >> thus cannot be represented with primary/secondary flags in the legacy >> interface. It was discussed on the dri-devel list in these two threads: >> >> http://lists.freedesktop.org/archives/dri-devel/2011-March/009009.html >> http://lists.freedesktop.org/archives/dri-devel/2011-March/009025.html >> >> This patch extends the interface to drm_wait_vblank ioctl so that crtc>1= can >> be represented. It also adds a new capability to drm_getcap ioctl so tha= t >> the user space can check whether the new interface to drm_wait_vblank is >> supported (and fall back to the legacy interface if not) >> >> Regards, >> >> Ilija >> >> >> Reviewed-by: Mario Kleiner >> Acked-by: Mario Kleiner > > Looks good to me. > > Reviewed-by: Alex Deucher > Tested-by: Alex Deucher > Signed-off-by: Ilija Hadzic >> >> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c >> index 7f6912a..3617b4c 100644 >> --- a/drivers/gpu/drm/drm_ioctl.c >> +++ b/drivers/gpu/drm/drm_ioctl.c >> @@ -280,6 +280,9 @@ int drm_getcap(struct drm_device *dev, void *data, >> struct drm_file *file_priv) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (dev->driver->dumb_create) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0req->value =3D 1; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; >> + =A0 =A0 =A0 case DRM_CAP_HIGH_CRTC: >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 req->value =3D 1; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; >> =A0 =A0 =A0 =A0default: >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -EINVAL; >> =A0 =A0 =A0 =A0} >> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c >> index a34ef97..c725088 100644 >> --- a/drivers/gpu/drm/drm_irq.c >> +++ b/drivers/gpu/drm/drm_irq.c >> @@ -1125,7 +1125,7 @@ int drm_wait_vblank(struct drm_device *dev, void >> *data, >> =A0{ >> =A0 =A0 =A0 =A0union drm_wait_vblank *vblwait =3D data; >> =A0 =A0 =A0 =A0int ret =3D 0; >> - =A0 =A0 =A0 unsigned int flags, seq, crtc; >> + =A0 =A0 =A0 unsigned int flags, seq, crtc, high_crtc; >> >> =A0 =A0 =A0 =A0if ((!drm_dev_to_irq(dev)) || (!dev->irq_enabled)) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -EINVAL; >> @@ -1134,16 +1134,21 @@ int drm_wait_vblank(struct drm_device *dev, void >> *data, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -EINVAL; >> >> =A0 =A0 =A0 =A0if (vblwait->request.type & >> - =A0 =A0 =A0 =A0 =A0 ~(_DRM_VBLANK_TYPES_MASK | _DRM_VBLANK_FLAGS_MASK)= ) { >> + =A0 =A0 =A0 =A0 =A0 ~(_DRM_VBLANK_TYPES_MASK | _DRM_VBLANK_FLAGS_MASK = | + >> =A0 _DRM_VBLANK_HIGH_CRTC_MASK)) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DRM_ERROR("Unsupported type value 0x%x, s= upported mask >> 0x%x\n", >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vblwait->request.type= , >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (_DRM_VBLANK_TYPES_MAS= K | >> _DRM_VBLANK_FLAGS_MASK)); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (_DRM_VBLANK_TYPES_MAS= K | _DRM_VBLANK_FLAGS_MASK | >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 _DRM_VBLANK_HIGH_CRTC_MASK)); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -EINVAL; >> =A0 =A0 =A0 =A0} >> >> =A0 =A0 =A0 =A0flags =3D vblwait->request.type & _DRM_VBLANK_FLAGS_MASK; >> - =A0 =A0 =A0 crtc =3D flags & _DRM_VBLANK_SECONDARY ? 1 : 0; >> - >> + =A0 =A0 =A0 high_crtc =3D (vblwait->request.type & _DRM_VBLANK_HIGH_CR= TC_MASK); >> + =A0 =A0 =A0 if (high_crtc) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 crtc =3D high_crtc >> _DRM_VBLANK_HIGH_CRT= C_SHIFT; >> + =A0 =A0 =A0 else >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 crtc =3D flags & _DRM_VBLANK_SECONDARY ? 1= : 0; >> =A0 =A0 =A0 =A0if (crtc >=3D dev->num_crtcs) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -EINVAL; >> >> diff --git a/include/drm/drm.h b/include/drm/drm.h >> index 9ac4313..99cd074 100644 >> --- a/include/drm/drm.h >> +++ b/include/drm/drm.h >> @@ -469,6 +469,8 @@ enum drm_vblank_seq_type { >> =A0 =A0 =A0 =A0_DRM_VBLANK_SECONDARY =3D 0x20000000, =A0 =A0 /**< Second= ary display >> controller */ >> =A0 =A0 =A0 =A0_DRM_VBLANK_SIGNAL =3D 0x40000000 /**< Send signal instea= d of blocking, >> unsupported */ >> =A0}; >> +#define _DRM_VBLANK_HIGH_CRTC_SHIFT 16 >> +#define _DRM_VBLANK_HIGH_CRTC_MASK 0x001F0000 >> >> =A0#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | >> _DRM_VBLANK_RELATIVE) >> =A0#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNA= L | \ >> @@ -753,6 +755,7 @@ struct drm_event_vblank { >> =A0}; >> >> =A0#define DRM_CAP_DUMB_BUFFER 0x1 >> +#define DRM_CAP_HIGH_CRTC 0x2 >> >> =A0/* typedef area */ >> =A0#ifndef __KERNEL__ >> > ---559023410-851401618-1300642307=:20979 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ---559023410-851401618-1300642307=:20979--