mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 02:58:05 +02:00
radeon/r200/r300: make legacy emit non-r300 specific
This commit is contained in:
parent
e7d06a55c5
commit
8c6a7d0174
7 changed files with 61 additions and 33 deletions
|
|
@ -30,6 +30,8 @@ DRIVER_SOURCES = r200_context.c \
|
|||
radeon_screen.c \
|
||||
common_lock.c \
|
||||
common_misc.c \
|
||||
radeon_bo_legacy.c \
|
||||
radeon_cs_legacy.c \
|
||||
$(EGL_SOURCES)
|
||||
|
||||
C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES)
|
||||
|
|
@ -50,6 +52,8 @@ COMMON_SYMLINKS = \
|
|||
radeon_chipset.h \
|
||||
radeon_screen.c \
|
||||
radeon_screen.h \
|
||||
radeon_bo_legacy.c \
|
||||
radeon_cs_legacy.c \
|
||||
radeon_bo_legacy.h \
|
||||
radeon_cs_legacy.h \
|
||||
radeon_buffer.h \
|
||||
|
|
@ -59,6 +63,7 @@ COMMON_SYMLINKS = \
|
|||
common_misc.h \
|
||||
common_misc.c
|
||||
|
||||
DRI_LIB_DEPS += -ldrm_radeon
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
|
|
|
|||
|
|
@ -272,6 +272,10 @@ static void r200_vtbl_set_all_dirty(GLcontext *ctx)
|
|||
rmesa->hw.all_dirty = GL_TRUE;
|
||||
}
|
||||
|
||||
static void r200_vtbl_emit_cs_header(struct radeon_cs *cs, radeonContextPtr rmesa)
|
||||
{
|
||||
}
|
||||
|
||||
static void r200_init_vtbl(radeonContextPtr radeon)
|
||||
{
|
||||
radeon->vtbl.get_lock = r200_get_lock;
|
||||
|
|
@ -279,8 +283,10 @@ static void r200_init_vtbl(radeonContextPtr radeon)
|
|||
radeon->vtbl.flush = r200_vtbl_flush;
|
||||
radeon->vtbl.set_all_dirty = r200_vtbl_set_all_dirty;
|
||||
radeon->vtbl.update_draw_buffer = r200UpdateDrawBuffer;
|
||||
radeon->vtbl.emit_cs_header = r200_vtbl_emit_cs_header;
|
||||
}
|
||||
|
||||
|
||||
/* Create the device specific rendering context.
|
||||
*/
|
||||
GLboolean r200CreateContext( const __GLcontextModes *glVisual,
|
||||
|
|
|
|||
|
|
@ -210,6 +210,37 @@ static void r300_vtbl_set_all_dirty(GLcontext *ctx)
|
|||
rmesa->hw.all_dirty = GL_TRUE;
|
||||
}
|
||||
|
||||
extern int cs_write_dword(struct radeon_cs *cs, uint32_t dword);
|
||||
|
||||
static void r300_vtbl_emit_cs_header(struct radeon_cs *cs, radeonContextPtr rmesa)
|
||||
{
|
||||
/* please flush pipe do all pending work */
|
||||
cs_write_dword(cs, cmdpacket0(rmesa->radeonScreen,
|
||||
R300_SC_SCREENDOOR, 1));
|
||||
cs_write_dword(cs, 0x0);
|
||||
cs_write_dword(cs, cmdpacket0(rmesa->radeonScreen,
|
||||
R300_SC_SCREENDOOR, 1));
|
||||
cs_write_dword(cs, 0x00FFFFFF);
|
||||
cs_write_dword(cs, cmdpacket0(rmesa->radeonScreen,
|
||||
R300_SC_HYPERZ, 1));
|
||||
cs_write_dword(cs, 0x0);
|
||||
cs_write_dword(cs, cmdpacket0(rmesa->radeonScreen,
|
||||
R300_US_CONFIG, 1));
|
||||
cs_write_dword(cs, 0x0);
|
||||
cs_write_dword(cs, cmdpacket0(rmesa->radeonScreen,
|
||||
R300_ZB_CNTL, 1));
|
||||
cs_write_dword(cs, 0x0);
|
||||
cs_write_dword(cs, cmdwait(rmesa->radeonScreen, R300_WAIT_3D));
|
||||
cs_write_dword(cs, cmdpacket0(rmesa->radeonScreen,
|
||||
R300_RB3D_DSTCACHE_CTLSTAT, 1));
|
||||
cs_write_dword(cs, R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D);
|
||||
cs_write_dword(cs, cmdpacket0(rmesa->radeonScreen,
|
||||
R300_ZB_ZCACHE_CTLSTAT, 1));
|
||||
cs_write_dword(cs, R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE);
|
||||
cs_write_dword(cs, cmdwait(rmesa->radeonScreen,
|
||||
R300_WAIT_3D | R300_WAIT_3D_CLEAN));
|
||||
}
|
||||
|
||||
static void r300_init_vtbl(radeonContextPtr radeon)
|
||||
{
|
||||
radeon->vtbl.get_lock = r300_get_lock;
|
||||
|
|
@ -217,6 +248,7 @@ static void r300_init_vtbl(radeonContextPtr radeon)
|
|||
radeon->vtbl.flush = r300_vtbl_flush;
|
||||
radeon->vtbl.set_all_dirty = r300_vtbl_set_all_dirty;
|
||||
radeon->vtbl.update_draw_buffer = r300UpdateDrawBuffer;
|
||||
radeon->vtbl.emit_cs_header = r300_vtbl_emit_cs_header;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ DRIVER_SOURCES = \
|
|||
radeon_maos.c \
|
||||
radeon_sanity.c \
|
||||
common_lock.c \
|
||||
common_misc.c
|
||||
common_misc.c \
|
||||
radeon_bo_legacy.c \
|
||||
radeon_cs_legacy.c
|
||||
|
||||
C_SOURCES = \
|
||||
$(COMMON_SOURCES) \
|
||||
|
|
@ -31,6 +33,8 @@ C_SOURCES = \
|
|||
|
||||
DRIVER_DEFINES = -DRADEON_COMMON=0
|
||||
|
||||
DRI_LIB_DEPS += -ldrm_radeon
|
||||
|
||||
X86_SOURCES =
|
||||
|
||||
include ../Makefile.template
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@
|
|||
#include "tnl/t_context.h"
|
||||
#include "main/colormac.h"
|
||||
|
||||
#include "radeon_screen.h"
|
||||
#include "radeon_drm.h"
|
||||
#include "dri_util.h"
|
||||
|
||||
/* This union is used to avoid warnings/miscompilation
|
||||
with float to uint32_t casts due to strict-aliasing */
|
||||
|
|
@ -333,6 +336,7 @@ struct radeon_context {
|
|||
void (*flush)(GLcontext *ctx);
|
||||
void (*set_all_dirty)(GLcontext *ctx);
|
||||
void (*update_draw_buffer)(GLcontext *ctx);
|
||||
void (*emit_cs_header)(struct radeon_cs *cs, radeonContextPtr rmesa);
|
||||
} vtbl;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -41,12 +41,13 @@
|
|||
#include <sys/ioctl.h>
|
||||
#include "xf86drm.h"
|
||||
#include "texmem.h"
|
||||
#include "main/simple_list.h"
|
||||
|
||||
#include "drm.h"
|
||||
#include "radeon_drm.h"
|
||||
#include "radeon_bo.h"
|
||||
#include "radeon_bo_legacy.h"
|
||||
#include "radeon_ioctl.h"
|
||||
|
||||
#include "common_context.h"
|
||||
|
||||
struct bo_legacy {
|
||||
struct radeon_bo base;
|
||||
|
|
|
|||
|
|
@ -30,13 +30,13 @@
|
|||
* Jérôme Glisse <glisse@freedesktop.org>
|
||||
*/
|
||||
#include <errno.h>
|
||||
#include "r300_reg.h"
|
||||
#include "r300_emit.h"
|
||||
#include "r300_cmdbuf.h"
|
||||
|
||||
|
||||
#include "common_context.h"
|
||||
#include "radeon_cs.h"
|
||||
#include "radeon_cs_legacy.h"
|
||||
#include "radeon_bo_legacy.h"
|
||||
#include "radeon_context.h"
|
||||
|
||||
|
||||
struct cs_manager_legacy {
|
||||
struct radeon_cs_manager base;
|
||||
|
|
@ -73,7 +73,7 @@ static struct radeon_cs *cs_create(struct radeon_cs_manager *csm,
|
|||
return cs;
|
||||
}
|
||||
|
||||
static int cs_write_dword(struct radeon_cs *cs, uint32_t dword)
|
||||
int cs_write_dword(struct radeon_cs *cs, uint32_t dword)
|
||||
{
|
||||
if (cs->cdw >= cs->ndw) {
|
||||
uint32_t tmp, *ptr;
|
||||
|
|
@ -277,31 +277,7 @@ static int cs_emit(struct radeon_cs *cs)
|
|||
uint64_t ull;
|
||||
int r;
|
||||
|
||||
/* please flush pipe do all pending work */
|
||||
cs_write_dword(cs, cmdpacket0(csm->ctx->radeonScreen,
|
||||
R300_SC_SCREENDOOR, 1));
|
||||
cs_write_dword(cs, 0x0);
|
||||
cs_write_dword(cs, cmdpacket0(csm->ctx->radeonScreen,
|
||||
R300_SC_SCREENDOOR, 1));
|
||||
cs_write_dword(cs, 0x00FFFFFF);
|
||||
cs_write_dword(cs, cmdpacket0(csm->ctx->radeonScreen,
|
||||
R300_SC_HYPERZ, 1));
|
||||
cs_write_dword(cs, 0x0);
|
||||
cs_write_dword(cs, cmdpacket0(csm->ctx->radeonScreen,
|
||||
R300_US_CONFIG, 1));
|
||||
cs_write_dword(cs, 0x0);
|
||||
cs_write_dword(cs, cmdpacket0(csm->ctx->radeonScreen,
|
||||
R300_ZB_CNTL, 1));
|
||||
cs_write_dword(cs, 0x0);
|
||||
cs_write_dword(cs, cmdwait(csm->ctx->radeonScreen, R300_WAIT_3D));
|
||||
cs_write_dword(cs, cmdpacket0(csm->ctx->radeonScreen,
|
||||
R300_RB3D_DSTCACHE_CTLSTAT, 1));
|
||||
cs_write_dword(cs, R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D);
|
||||
cs_write_dword(cs, cmdpacket0(csm->ctx->radeonScreen,
|
||||
R300_ZB_ZCACHE_CTLSTAT, 1));
|
||||
cs_write_dword(cs, R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE);
|
||||
cs_write_dword(cs, cmdwait(csm->ctx->radeonScreen,
|
||||
R300_WAIT_3D | R300_WAIT_3D_CLEAN));
|
||||
csm->ctx->vtbl.emit_cs_header(cs, csm->ctx);
|
||||
|
||||
/* append buffer age */
|
||||
age.scratch.cmd_type = R300_CMD_SCRATCH;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue