From owner-svn-src-head@FreeBSD.ORG Sun Aug 23 15:02:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9124106568D; Sun, 23 Aug 2009 15:02:58 +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 97B4B8FC08; Sun, 23 Aug 2009 15:02:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7NF2wrR064332; Sun, 23 Aug 2009 15:02:58 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7NF2w1C064327; Sun, 23 Aug 2009 15:02:58 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200908231502.n7NF2w1C064327@svn.freebsd.org> From: Robert Noland Date: Sun, 23 Aug 2009 15:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196471 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2009 15:02:58 -0000 Author: rnoland Date: Sun Aug 23 15:02:58 2009 New Revision: 196471 URL: http://svn.freebsd.org/changeset/base/196471 Log: Add GET_PARAM support for Z pipes. This is needed for occulsion queries on rv530 chips. MFC after: 2 weeks Modified: head/sys/dev/drm/radeon_cp.c head/sys/dev/drm/radeon_drm.h head/sys/dev/drm/radeon_drv.h head/sys/dev/drm/radeon_state.c Modified: head/sys/dev/drm/radeon_cp.c ============================================================================== --- head/sys/dev/drm/radeon_cp.c Sun Aug 23 14:55:57 2009 (r196470) +++ head/sys/dev/drm/radeon_cp.c Sun Aug 23 15:02:58 2009 (r196471) @@ -408,6 +408,15 @@ static void radeon_init_pipes(drm_radeon { uint32_t gb_tile_config, gb_pipe_sel = 0; + if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV530) { + uint32_t z_pipe_sel = RADEON_READ(RV530_GB_PIPE_SELECT2); + if ((z_pipe_sel & 3) == 3) + dev_priv->num_z_pipes = 2; + else + dev_priv->num_z_pipes = 1; + } else + dev_priv->num_z_pipes = 1; + /* RS4xx/RS6xx/R4xx/R5xx */ if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R420) { gb_pipe_sel = RADEON_READ(R400_GB_PIPE_SELECT); Modified: head/sys/dev/drm/radeon_drm.h ============================================================================== --- head/sys/dev/drm/radeon_drm.h Sun Aug 23 14:55:57 2009 (r196470) +++ head/sys/dev/drm/radeon_drm.h Sun Aug 23 15:02:58 2009 (r196471) @@ -688,6 +688,8 @@ typedef struct drm_radeon_indirect { #define RADEON_PARAM_VBLANK_CRTC 13 /* VBLANK CRTC */ #define RADEON_PARAM_FB_LOCATION 14 /* FB location */ #define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */ +#define RADEON_PARAM_DEVICE_ID 16 +#define RADEON_PARAM_NUM_Z_PIPES 17 /* num Z pipes */ typedef struct drm_radeon_getparam { int param; Modified: head/sys/dev/drm/radeon_drv.h ============================================================================== --- head/sys/dev/drm/radeon_drv.h Sun Aug 23 14:55:57 2009 (r196470) +++ head/sys/dev/drm/radeon_drv.h Sun Aug 23 15:02:58 2009 (r196471) @@ -102,9 +102,11 @@ __FBSDID("$FreeBSD$"); * 1.27- Add support for IGP GART * 1.28- Add support for VBL on CRTC2 * 1.29- R500 3D cmd buffer support + * 1.30- Add support for occlusion queries + * 1.31- Add support for num Z pipes from GET_PARAM */ #define DRIVER_MAJOR 1 -#define DRIVER_MINOR 29 +#define DRIVER_MINOR 31 #define DRIVER_PATCHLEVEL 0 /* @@ -368,6 +370,7 @@ typedef struct drm_radeon_private { unsigned long fb_aper_offset; int num_gb_pipes; + int num_z_pipes; int track_flush; drm_local_map_t *mmio; @@ -758,6 +761,7 @@ extern int r600_cs_init(struct drm_devic /* pipe config regs */ #define R400_GB_PIPE_SELECT 0x402c +#define RV530_GB_PIPE_SELECT2 0x4124 #define R500_DYN_SCLK_PWMEM_PIPE 0x000d /* PLL */ #define R300_GB_TILE_CONFIG 0x4018 # define R300_ENABLE_TILING (1 << 0) Modified: head/sys/dev/drm/radeon_state.c ============================================================================== --- head/sys/dev/drm/radeon_state.c Sun Aug 23 14:55:57 2009 (r196470) +++ head/sys/dev/drm/radeon_state.c Sun Aug 23 15:02:58 2009 (r196471) @@ -3078,6 +3078,9 @@ static int radeon_cp_getparam(struct drm case RADEON_PARAM_NUM_GB_PIPES: value = dev_priv->num_gb_pipes; break; + case RADEON_PARAM_NUM_Z_PIPES: + value = dev_priv->num_z_pipes; + break; default: DRM_DEBUG("Invalid parameter %d\n", param->param); return -EINVAL;