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)
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 \
common_misc.h \
common_misc.c
+DRI_LIB_DEPS += -ldrm_radeon
##### TARGETS #####
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;
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,
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;
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;
}
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) \
DRIVER_DEFINES = -DRADEON_COMMON=0
+DRI_LIB_DEPS += -ldrm_radeon
+
X86_SOURCES =
include ../Makefile.template
#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 */
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;
};
#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;
* 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;
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;
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;