r300: Add path for pci_id in winsys.

Needs to be hooked up to the getparam from the kernel.
This commit is contained in:
Corbin Simpson 2009-01-20 01:49:34 -08:00
parent 43f20357c8
commit 502ddfcd57
6 changed files with 12 additions and 4 deletions

View File

@ -43,7 +43,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
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;

View File

@ -28,6 +28,7 @@
#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 */

View File

@ -38,6 +38,9 @@ struct radeon_cs;
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. */

View File

@ -244,9 +244,11 @@ GLboolean amd_context_create(const __GLcontextModes *visual,
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);
}

View File

@ -43,12 +43,14 @@ static void amd_r300_flush_cs(struct radeon_cs* cs)
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;

View File

@ -26,4 +26,4 @@
#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);