From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 11 02:13:47 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FDB110656EB; Wed, 11 Mar 2009 02:13:47 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C41B8FC17; Wed, 11 Mar 2009 02:13:47 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2B2DlHK080816; Wed, 11 Mar 2009 02:13:47 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2B2DkSW080810; Wed, 11 Mar 2009 02:13:46 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903110213.n2B2DkSW080810@svn.freebsd.org> From: Robert Noland Date: Wed, 11 Mar 2009 02:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189670 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2009 02:13:48 -0000 Author: rnoland Date: Wed Mar 11 02:13:46 2009 New Revision: 189670 URL: http://svn.freebsd.org/changeset/base/189670 Log: Merge r189054 The GM45 handles vblank differently. Pull the changes from Intel in. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/drm/i915_dma.c stable/7/sys/dev/drm/i915_drv.c stable/7/sys/dev/drm/i915_drv.h stable/7/sys/dev/drm/i915_irq.c stable/7/sys/dev/drm/i915_reg.h Modified: stable/7/sys/dev/drm/i915_dma.c ============================================================================== --- stable/7/sys/dev/drm/i915_dma.c Wed Mar 11 02:00:13 2009 (r189669) +++ stable/7/sys/dev/drm/i915_dma.c Wed Mar 11 02:13:46 2009 (r189670) @@ -868,6 +868,12 @@ int i915_driver_load(struct drm_device * ret = drm_addmap(dev, base, size, _DRM_REGISTERS, _DRM_KERNEL | _DRM_DRIVER, &dev_priv->mmio_map); + + if (IS_GM45(dev)) + dev->driver->get_vblank_counter = gm45_get_vblank_counter; + else + dev->driver->get_vblank_counter = i915_get_vblank_counter; + #ifdef I915_HAVE_GEM i915_gem_load(dev); #endif Modified: stable/7/sys/dev/drm/i915_drv.c ============================================================================== --- stable/7/sys/dev/drm/i915_drv.c Wed Mar 11 02:00:13 2009 (r189669) +++ stable/7/sys/dev/drm/i915_drv.c Wed Mar 11 02:13:46 2009 (r189670) @@ -81,7 +81,6 @@ static void i915_configure(struct drm_de dev->driver->preclose = i915_driver_preclose; dev->driver->lastclose = i915_driver_lastclose; dev->driver->device_is_agp = i915_driver_device_is_agp; - dev->driver->get_vblank_counter = i915_get_vblank_counter; dev->driver->enable_vblank = i915_enable_vblank; dev->driver->disable_vblank = i915_disable_vblank; dev->driver->irq_preinstall = i915_driver_irq_preinstall; Modified: stable/7/sys/dev/drm/i915_drv.h ============================================================================== --- stable/7/sys/dev/drm/i915_drv.h Wed Mar 11 02:00:13 2009 (r189669) +++ stable/7/sys/dev/drm/i915_drv.h Wed Mar 11 02:13:46 2009 (r189670) @@ -449,6 +449,7 @@ extern int i915_vblank_pipe_get(struct d extern int i915_enable_vblank(struct drm_device *dev, int crtc); extern void i915_disable_vblank(struct drm_device *dev, int crtc); extern u32 i915_get_vblank_counter(struct drm_device *dev, int crtc); +extern u32 gm45_get_vblank_counter(struct drm_device *dev, int crtc); extern int i915_vblank_swap(struct drm_device *dev, void *data, struct drm_file *file_priv); Modified: stable/7/sys/dev/drm/i915_irq.c ============================================================================== --- stable/7/sys/dev/drm/i915_irq.c Wed Mar 11 02:00:13 2009 (r189669) +++ stable/7/sys/dev/drm/i915_irq.c Wed Mar 11 02:13:46 2009 (r189670) @@ -170,6 +170,19 @@ u32 i915_get_vblank_counter(struct drm_d return count; } +u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe) +{ + drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + int reg = pipe ? PIPEB_FRMCOUNT_GM45 : PIPEA_FRMCOUNT_GM45; + + if (!i915_pipe_enabled(dev, pipe)) { + DRM_ERROR("trying to get vblank count for disabled pipe %d\n", pipe); + return 0; + } + + return I915_READ(reg); +} + irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) { struct drm_device *dev = (struct drm_device *) arg; Modified: stable/7/sys/dev/drm/i915_reg.h ============================================================================== --- stable/7/sys/dev/drm/i915_reg.h Wed Mar 11 02:00:13 2009 (r189669) +++ stable/7/sys/dev/drm/i915_reg.h Wed Mar 11 02:13:46 2009 (r189670) @@ -1329,6 +1329,9 @@ __FBSDID("$FreeBSD$"); #define PIPE_FRAME_LOW_SHIFT 24 #define PIPE_PIXEL_MASK 0x00ffffff #define PIPE_PIXEL_SHIFT 0 +/* GM45+ just has to be different */ +#define PIPEA_FRMCOUNT_GM45 0x70040 +#define PIPEA_FLIPCOUNT_GM45 0x70044 /* Cursor A & B regs */ #define CURACNTR 0x70080 @@ -1397,6 +1400,8 @@ __FBSDID("$FreeBSD$"); #define PIPEBSTAT 0x71024 #define PIPEBFRAMEHIGH 0x71040 #define PIPEBFRAMEPIXEL 0x71044 +#define PIPEB_FRMCOUNT_GM45 0x71040 +#define PIPEB_FLIPCOUNT_GM45 0x71044 /* Display B control */ #define DSPBCNTR 0x71180