Needs to be hooked up to the getparam from the kernel.
r300->winsys = r300_winsys;
r300->context.winsys = winsys;
- r300->context.screen = r300_create_screen(winsys, 0x0);
+ r300->context.screen = r300_create_screen(winsys, r300_winsys->pci_id);
r300->context.destroy = r300_destroy_context;
#include "util/u_memory.h"
#include "r300_screen.h"
+#include "r300_winsys.h"
struct r300_blend_state {
uint32_t blend_control; /* R300_RB3D_CBLEND: 0x4e04 */
struct r300_winsys {
+ /* PCI ID */
+ uint32_t pci_id;
+
/* CS object. This is very much like Intel's batchbuffer.
* Fill it full of dwords and relocs and then submit.
* Repeat as needed. */
if (GL_TRUE) {
fprintf(stderr, "Creating r300 context...");
+ /* XXX today we pretend to be a very lame R300 vvvvvv */
pipe = r300_create_context(NULL,
amd_context->pipe_winsys,
- amd_create_r300_winsys(amd_context->drm_fd));
+ amd_create_r300_winsys(amd_context->drm_fd,
+ 0x4144));
} else {
pipe = amd_create_softpipe(amd_context);
}
radeon_cs_erase(cs);
}
-struct r300_winsys* amd_create_r300_winsys(int fd)
+struct r300_winsys* amd_create_r300_winsys(int fd, uint32_t pci_id)
{
struct r300_winsys* winsys = calloc(1, sizeof(struct r300_winsys));
struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd);
+ winsys->pci_id = pci_id;
+
winsys->cs = radeon_cs_create(csm, 1024 * 64 / 4);
winsys->check_cs = amd_r300_check_cs;
#include "amd_buffer.h"
-struct r300_winsys* amd_create_r300_winsys(int fd);
+struct r300_winsys* amd_create_r300_winsys(int fd, uint32_t pci_id);