#include "nouveau/nouveau_bo.h"
#include "nouveau/nouveau_channel.h"
#include "nouveau/nouveau_class.h"
+#include "nouveau/nouveau_device.h"
#include "nouveau/nouveau_grobj.h"
#include "nouveau/nouveau_notifier.h"
#include "nouveau/nouveau_resource.h"
};
extern struct pipe_screen *
-nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *,
- unsigned chipset);
+nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);
extern struct pipe_context *
nv10_create(struct pipe_screen *, unsigned pctx_id);
extern struct pipe_screen *
-nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *,
- unsigned chipset);
+nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);
extern struct pipe_context *
nv30_create(struct pipe_screen *, unsigned pctx_id);
extern struct pipe_screen *
-nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *,
- unsigned chipset);
+nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);
extern struct pipe_context *
nv40_create(struct pipe_screen *, unsigned pctx_id);
extern struct pipe_screen *
-nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *,
- unsigned chipset);
+nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);
extern struct pipe_context *
nv50_create(struct pipe_screen *, unsigned pctx_id);
struct nv10_screen *screen = nv10_screen(pscreen);
struct pipe_winsys *ws = pscreen->winsys;
struct nv10_context *nv10;
- unsigned chipset = screen->chipset;
struct nouveau_winsys *nvws = screen->nvws;
nv10 = CALLOC(1, sizeof(struct nv10_context));
nv10->screen = screen;
nv10->pctx_id = pctx_id;
- nv10->chipset = chipset;
nv10->nvws = nvws;
nv10->pipe.winsys = ws;
struct draw_context *draw;
- int chipset;
-
uint32_t dirty;
struct nv10_sampler_state *tex_sampler[PIPE_MAX_SAMPLERS];
nv10_screen_get_name(struct pipe_screen *screen)
{
struct nv10_screen *nv10screen = nv10_screen(screen);
+ struct nouveau_device *dev = nv10screen->nvws->channel->device;
static char buffer[128];
- snprintf(buffer, sizeof(buffer), "NV%02X", nv10screen->chipset);
+ snprintf(buffer, sizeof(buffer), "NV%02X", dev->chipset);
return buffer;
}
}
struct pipe_screen *
-nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws,
- unsigned chipset)
+nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
{
struct nv10_screen *screen = CALLOC_STRUCT(nv10_screen);
unsigned celsius_class;
+ unsigned chipset = nvws->channel->device->chipset;
int ret;
if (!screen)
return NULL;
- screen->chipset = chipset;
screen->nvws = nvws;
/* 3D object */
struct pipe_screen pipe;
struct nouveau_winsys *nvws;
- unsigned chipset;
/* HW graphics objects */
struct nouveau_grobj *celsius;
struct nv30_screen *screen = nv30_screen(pscreen);
struct pipe_winsys *ws = pscreen->winsys;
struct nv30_context *nv30;
- unsigned chipset = screen->chipset;
struct nouveau_winsys *nvws = screen->nvws;
nv30 = CALLOC(1, sizeof(struct nv30_context));
nv30->screen = screen;
nv30->pctx_id = pctx_id;
- nv30->chipset = chipset;
nv30->nvws = nvws;
nv30->pipe.winsys = ws;
struct draw_context *draw;
- int chipset;
-
uint32_t dirty;
struct nv30_sampler_state *tex_sampler[PIPE_MAX_SAMPLERS];
nv30_screen_get_name(struct pipe_screen *pscreen)
{
struct nv30_screen *screen = nv30_screen(pscreen);
+ struct nouveau_device *dev = screen->nvws->channel->device;
static char buffer[128];
- snprintf(buffer, sizeof(buffer), "NV%02X", screen->chipset);
+ snprintf(buffer, sizeof(buffer), "NV%02X", dev->chipset);
return buffer;
}
}
struct pipe_screen *
-nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws,
- unsigned chipset)
+nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
{
struct nv30_screen *screen = CALLOC_STRUCT(nv30_screen);
struct nouveau_stateobj *so;
unsigned rankine_class = 0;
+ unsigned chipset = nvws->channel->device->chipset;
int ret, i;
if (!screen)
return NULL;
- screen->chipset = chipset;
screen->nvws = nvws;
/* 3D object */
struct pipe_screen pipe;
struct nouveau_winsys *nvws;
- unsigned chipset;
/* HW graphics objects */
struct nouveau_grobj *rankine;
struct nv40_screen *screen = nv40_screen(pscreen);
struct pipe_winsys *ws = pscreen->winsys;
struct nv40_context *nv40;
- unsigned chipset = screen->chipset;
struct nouveau_winsys *nvws = screen->nvws;
nv40 = CALLOC(1, sizeof(struct nv40_context));
nv40->screen = screen;
nv40->pctx_id = pctx_id;
- nv40->chipset = chipset;
nv40->nvws = nvws;
nv40->pipe.winsys = ws;
struct draw_context *draw;
- int chipset;
-
/* HW state derived from pipe states */
struct nv40_state state;
struct {
nv40_screen_get_name(struct pipe_screen *pscreen)
{
struct nv40_screen *screen = nv40_screen(pscreen);
+ struct nouveau_device *dev = screen->nvws->channel->device;
static char buffer[128];
- snprintf(buffer, sizeof(buffer), "NV%02X", screen->chipset);
+ snprintf(buffer, sizeof(buffer), "NV%02X", dev->chipset);
return buffer;
}
}
struct pipe_screen *
-nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws,
- unsigned chipset)
+nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
{
struct nv40_screen *screen = CALLOC_STRUCT(nv40_screen);
struct nouveau_stateobj *so;
unsigned curie_class;
+ unsigned chipset = nvws->channel->device;
int ret;
if (!screen)
return NULL;
- screen->chipset = chipset;
screen->nvws = nvws;
/* 3D object */
struct pipe_screen pipe;
struct nouveau_winsys *nvws;
- unsigned chipset;
unsigned cur_pctx;
nv50_screen_get_name(struct pipe_screen *pscreen)
{
struct nv50_screen *screen = nv50_screen(pscreen);
+ struct nouveau_device *dev = screen->nvws->channel->device;
static char buffer[128];
- snprintf(buffer, sizeof(buffer), "NV%02X", screen->chipset);
+ snprintf(buffer, sizeof(buffer), "NV%02X", dev->chipset);
return buffer;
}
}
struct pipe_screen *
-nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws,
- unsigned chipset)
+nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
{
struct nv50_screen *screen = CALLOC_STRUCT(nv50_screen);
struct nouveau_stateobj *so;
unsigned tesla_class = 0, ret;
+ unsigned chipset = nvws->channel->device->chipset;
int i;
if (!screen)
return NULL;
- screen->chipset = chipset;
screen->nvws = nvws;
/* 3D object */
struct pipe_screen pipe;
struct nouveau_winsys *nvws;
- unsigned chipset;
unsigned cur_pctx;
struct nouveau_channel_context *nvc = nv->nvc;
struct nouveau_winsys *nvws = CALLOC_STRUCT(nouveau_winsys);
struct pipe_screen *(*hws_create)(struct pipe_winsys *,
- struct nouveau_winsys *,
- unsigned chipset);
+ struct nouveau_winsys *);
struct pipe_context *(*hw_create)(struct pipe_screen *, unsigned);
struct pipe_winsys *ws;
unsigned chipset = nv->nv_screen->device->chipset;
ws = nouveau_create_pipe_winsys(nv);
if (!nvc->pscreen)
- nvc->pscreen = hws_create(ws, nvws, chipset);
+ nvc->pscreen = hws_create(ws, nvws);
nvc->pctx[nv->pctx_id] = hw_create(nvc->pscreen, nv->pctx_id);
return nvc->pctx[nv->pctx_id];
}