diff options
author | Christian König <[email protected]> | 2010-12-22 21:12:24 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2010-12-22 21:12:24 +0100 |
commit | e179a8bf34022c200deee92d328cb1bae3c3aa4a (patch) | |
tree | 4c67616380e7c0efa2d7ff0fe67fd18af2fa11ad /src/gallium/winsys | |
parent | 1b03996b1269fb8b2f89e0a013d8427da660ff83 (diff) | |
parent | 38c8b034e2775640c588711290c244632dcc2475 (diff) |
Merge remote branch 'origin/master' into pipe-video
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/r600/drm/Makefile | 1 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/SConscript | 1 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/evergreen_hw_context.c | 56 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/r600.c | 174 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/r600_drm.c | 68 | ||||
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_common.c | 4 | ||||
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_r300.c | 2 | ||||
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_winsys.h | 4 |
8 files changed, 24 insertions, 286 deletions
diff --git a/src/gallium/winsys/r600/drm/Makefile b/src/gallium/winsys/r600/drm/Makefile index 91c65012c83..7310734f051 100644 --- a/src/gallium/winsys/r600/drm/Makefile +++ b/src/gallium/winsys/r600/drm/Makefile @@ -9,7 +9,6 @@ C_SOURCES = \ evergreen_hw_context.c \ radeon_bo.c \ radeon_pciid.c \ - r600.c \ r600_bo.c \ r600_drm.c \ r600_hw_context.c \ diff --git a/src/gallium/winsys/r600/drm/SConscript b/src/gallium/winsys/r600/drm/SConscript index dac0097f144..f97434e995d 100644 --- a/src/gallium/winsys/r600/drm/SConscript +++ b/src/gallium/winsys/r600/drm/SConscript @@ -7,7 +7,6 @@ r600_sources = [ 'evergreen_hw_context.c', 'radeon_bo.c', 'radeon_pciid.c', - 'r600.c', 'r600_bo.c', 'r600_drm.c', 'r600_hw_context.c', diff --git a/src/gallium/winsys/r600/drm/evergreen_hw_context.c b/src/gallium/winsys/r600/drm/evergreen_hw_context.c index 2175d578ec7..47d73c2e094 100644 --- a/src/gallium/winsys/r600/drm/evergreen_hw_context.c +++ b/src/gallium/winsys/r600/drm/evergreen_hw_context.c @@ -880,59 +880,3 @@ void evergreen_context_draw(struct r600_context *ctx, const struct r600_draw *dr ctx->pm4_dirty_cdwords = 0; } -static inline void evergreen_resource_set(struct r600_context *ctx, struct r600_pipe_state *state, unsigned offset) -{ - struct r600_range *range; - struct r600_block *block; - - range = &ctx->range[CTX_RANGE_ID(ctx, offset)]; - block = range->blocks[CTX_BLOCK_ID(ctx, offset)]; - block->reg[0] = state->regs[0].value; - block->reg[1] = state->regs[1].value; - block->reg[2] = state->regs[2].value; - block->reg[3] = state->regs[3].value; - block->reg[4] = state->regs[4].value; - block->reg[5] = state->regs[5].value; - block->reg[6] = state->regs[6].value; - block->reg[7] = state->regs[7].value; - r600_bo_reference(ctx->radeon, &block->reloc[1].bo, NULL); - r600_bo_reference(ctx->radeon , &block->reloc[2].bo, NULL); - if (state->regs[0].bo) { - /* VERTEX RESOURCE, we preted there is 2 bo to relocate so - * we have single case btw VERTEX & TEXTURE resource - */ - r600_bo_reference(ctx->radeon, &block->reloc[1].bo, state->regs[0].bo); - r600_bo_reference(ctx->radeon, &block->reloc[2].bo, state->regs[0].bo); - } else { - /* TEXTURE RESOURCE */ - r600_bo_reference(ctx->radeon, &block->reloc[1].bo, state->regs[2].bo); - r600_bo_reference(ctx->radeon, &block->reloc[2].bo, state->regs[3].bo); - } - if (!(block->status & R600_BLOCK_STATUS_DIRTY)) { - block->status |= R600_BLOCK_STATUS_ENABLED; - block->status |= R600_BLOCK_STATUS_DIRTY; - ctx->pm4_dirty_cdwords += block->pm4_ndwords + block->pm4_flush_ndwords; - LIST_ADDTAIL(&block->list,&ctx->dirty); - } -} - -void evergreen_ps_resource_set(struct r600_context *ctx, struct r600_pipe_state *state, unsigned rid) -{ - unsigned offset = R_030000_RESOURCE0_WORD0 + 0x20 * rid; - - evergreen_resource_set(ctx, state, offset); -} - -void evergreen_vs_resource_set(struct r600_context *ctx, struct r600_pipe_state *state, unsigned rid) -{ - unsigned offset = R_030000_RESOURCE0_WORD0 + 0x1600 + 0x20 * rid; - - evergreen_resource_set(ctx, state, offset); -} - -void evergreen_fs_resource_set(struct r600_context *ctx, struct r600_pipe_state *state, unsigned rid) -{ - unsigned offset = R_030000_RESOURCE0_WORD0 + 0x7C00 + 0x20 * rid; - - evergreen_resource_set(ctx, state, offset); -} diff --git a/src/gallium/winsys/r600/drm/r600.c b/src/gallium/winsys/r600/drm/r600.c deleted file mode 100644 index b88733f80f1..00000000000 --- a/src/gallium/winsys/r600/drm/r600.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2010 Jerome Glisse <[email protected]> - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Authors: - * Jerome Glisse - */ -#include "xf86drm.h" -#include "radeon_drm.h" -#include "pipe/p_compiler.h" -#include "util/u_inlines.h" -#include "r600_priv.h" - -enum radeon_family r600_get_family(struct radeon *r600) -{ - return r600->family; -} - -enum chip_class r600_get_family_class(struct radeon *radeon) -{ - return radeon->chip_class; -} - -struct r600_tiling_info *r600_get_tiling_info(struct radeon *radeon) -{ - return &radeon->tiling_info; -} - -static int r600_get_device(struct radeon *r600) -{ - struct drm_radeon_info info; - - r600->device = 0; - info.request = RADEON_INFO_DEVICE_ID; - info.value = (uintptr_t)&r600->device; - return drmCommandWriteRead(r600->fd, DRM_RADEON_INFO, &info, sizeof(struct drm_radeon_info)); -} - -struct radeon *r600_new(int fd, unsigned device) -{ - struct radeon *r600; - int r; - - r600 = calloc(1, sizeof(*r600)); - if (r600 == NULL) { - return NULL; - } - r600->fd = fd; - r600->device = device; - if (fd >= 0) { - r = r600_get_device(r600); - if (r) { - R600_ERR("Failed to get device id\n"); - r600_delete(r600); - return NULL; - } - } - r600->family = radeon_family_from_device(r600->device); - if (r600->family == CHIP_UNKNOWN) { - R600_ERR("Unknown chipset 0x%04X\n", r600->device); - r600_delete(r600); - return NULL; - } - switch (r600->family) { - case CHIP_R600: - case CHIP_RV610: - case CHIP_RV630: - case CHIP_RV670: - case CHIP_RV620: - case CHIP_RV635: - case CHIP_RS780: - case CHIP_RS880: - case CHIP_RV770: - case CHIP_RV730: - case CHIP_RV710: - case CHIP_RV740: - case CHIP_CEDAR: - case CHIP_REDWOOD: - case CHIP_JUNIPER: - case CHIP_CYPRESS: - case CHIP_HEMLOCK: - case CHIP_PALM: - break; - case CHIP_R100: - case CHIP_RV100: - case CHIP_RS100: - case CHIP_RV200: - case CHIP_RS200: - case CHIP_R200: - case CHIP_RV250: - case CHIP_RS300: - case CHIP_RV280: - case CHIP_R300: - case CHIP_R350: - case CHIP_RV350: - case CHIP_RV380: - case CHIP_R420: - case CHIP_R423: - case CHIP_RV410: - case CHIP_RS400: - case CHIP_RS480: - case CHIP_RS600: - case CHIP_RS690: - case CHIP_RS740: - case CHIP_RV515: - case CHIP_R520: - case CHIP_RV530: - case CHIP_RV560: - case CHIP_RV570: - case CHIP_R580: - default: - R600_ERR("unknown or unsupported chipset 0x%04X\n", r600->device); - break; - } - - /* setup class */ - switch (r600->family) { - case CHIP_R600: - case CHIP_RV610: - case CHIP_RV630: - case CHIP_RV670: - case CHIP_RV620: - case CHIP_RV635: - case CHIP_RS780: - case CHIP_RS880: - r600->chip_class = R600; - break; - case CHIP_RV770: - case CHIP_RV730: - case CHIP_RV710: - case CHIP_RV740: - r600->chip_class = R700; - break; - case CHIP_CEDAR: - case CHIP_REDWOOD: - case CHIP_JUNIPER: - case CHIP_CYPRESS: - case CHIP_HEMLOCK: - case CHIP_PALM: - r600->chip_class = EVERGREEN; - break; - default: - R600_ERR("unknown or unsupported chipset 0x%04X\n", r600->device); - break; - } - - return r600; -} - -void r600_delete(struct radeon *r600) -{ - if (r600 == NULL) - return; - drmClose(r600->fd); - free(r600); -} diff --git a/src/gallium/winsys/r600/drm/r600_drm.c b/src/gallium/winsys/r600/drm/r600_drm.c index 3cbbf91878d..58aacb77c9e 100644 --- a/src/gallium/winsys/r600/drm/r600_drm.c +++ b/src/gallium/winsys/r600/drm/r600_drm.c @@ -42,6 +42,21 @@ static struct radeon *radeon_new(int fd, unsigned device); +enum radeon_family r600_get_family(struct radeon *r600) +{ + return r600->family; +} + +enum chip_class r600_get_family_class(struct radeon *radeon) +{ + return radeon->chip_class; +} + +struct r600_tiling_info *r600_get_tiling_info(struct radeon *radeon) +{ + return &radeon->tiling_info; +} + static int radeon_get_device(struct radeon *radeon) { struct drm_radeon_info info; @@ -134,59 +149,6 @@ static struct radeon *radeon_new(int fd, unsigned device) fprintf(stderr, "Unknown chipset 0x%04X\n", radeon->device); return radeon_decref(radeon); } - switch (radeon->family) { - case CHIP_R600: - case CHIP_RV610: - case CHIP_RV630: - case CHIP_RV670: - case CHIP_RV620: - case CHIP_RV635: - case CHIP_RS780: - case CHIP_RS880: - case CHIP_RV770: - case CHIP_RV730: - case CHIP_RV710: - case CHIP_RV740: - case CHIP_CEDAR: - case CHIP_REDWOOD: - case CHIP_JUNIPER: - case CHIP_CYPRESS: - case CHIP_HEMLOCK: - case CHIP_PALM: - break; - case CHIP_R100: - case CHIP_RV100: - case CHIP_RS100: - case CHIP_RV200: - case CHIP_RS200: - case CHIP_R200: - case CHIP_RV250: - case CHIP_RS300: - case CHIP_RV280: - case CHIP_R300: - case CHIP_R350: - case CHIP_RV350: - case CHIP_RV380: - case CHIP_R420: - case CHIP_R423: - case CHIP_RV410: - case CHIP_RS400: - case CHIP_RS480: - case CHIP_RS600: - case CHIP_RS690: - case CHIP_RS740: - case CHIP_RV515: - case CHIP_R520: - case CHIP_RV530: - case CHIP_RV560: - case CHIP_RV570: - case CHIP_R580: - default: - fprintf(stderr, "%s unknown or unsupported chipset 0x%04X\n", - __func__, radeon->device); - break; - } - /* setup class */ switch (radeon->family) { case CHIP_R600: diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_common.c b/src/gallium/winsys/radeon/drm/radeon_drm_common.c index 6bc6244115c..f38ab6e3b43 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_common.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_common.c @@ -122,6 +122,10 @@ static void do_ioctls(struct radeon_drm_winsys *winsys) (version->version_major == 2 && version->version_minor >= 6); + winsys->drm_2_8_0 = version->version_major > 2 || + (version->version_major == 2 && + version->version_minor >= 8); + info.request = RADEON_INFO_DEVICE_ID; retval = drmCommandWriteRead(winsys->fd, DRM_RADEON_INFO, &info, sizeof(info)); if (retval) { diff --git a/src/gallium/winsys/radeon/drm/radeon_r300.c b/src/gallium/winsys/radeon/drm/radeon_r300.c index 9f59b3de461..ae7020a0639 100644 --- a/src/gallium/winsys/radeon/drm/radeon_r300.c +++ b/src/gallium/winsys/radeon/drm/radeon_r300.c @@ -211,6 +211,8 @@ static uint32_t radeon_get_value(struct r300_winsys_screen *rws, return ws->drm_2_3_0; case R300_VID_DRM_2_6_0: return ws->drm_2_6_0; + case R300_VID_DRM_2_8_0: + return ws->drm_2_8_0; case R300_CAN_HYPERZ: return ws->hyperz; } diff --git a/src/gallium/winsys/radeon/drm/radeon_winsys.h b/src/gallium/winsys/radeon/drm/radeon_winsys.h index 81da1a25e0f..6f232143f6a 100644 --- a/src/gallium/winsys/radeon/drm/radeon_winsys.h +++ b/src/gallium/winsys/radeon/drm/radeon_winsys.h @@ -49,8 +49,10 @@ struct radeon_drm_winsys { boolean squaretiling; /* Square tiling support. */ /* DRM 2.3.0 (R500 VAP regs, MSPOS regs, fixed tex3D size checking) */ boolean drm_2_3_0; - /* DRM 2.6.0 (Hyper-Z, GB_Z_PEQ_CONFIG allowed on rv350->r4xx) */ + /* DRM 2.6.0 (Hyper-Z, GB_Z_PEQ_CONFIG allowed on rv350->r4xx, FG_ALPHA_VALUE) */ boolean drm_2_6_0; + /* DRM 2.8.0 (US_FORMAT regs, ARGB2101010 colorbuffer) */ + boolean drm_2_8_0; /* Hyper-Z user */ boolean hyperz; |