nv04: remove u_simple_screen usage
This commit is contained in:
parent
251c47117b
commit
d4d584b16e
|
@ -1,27 +1,9 @@
|
||||||
#include "pipe/p_screen.h"
|
#include "pipe/p_screen.h"
|
||||||
#include "pipe/p_inlines.h"
|
#include "pipe/p_inlines.h"
|
||||||
#include "util/u_simple_screen.h"
|
|
||||||
|
|
||||||
#include "nv04_context.h"
|
#include "nv04_context.h"
|
||||||
#include "nv04_screen.h"
|
#include "nv04_screen.h"
|
||||||
|
|
||||||
static const char *
|
|
||||||
nv04_screen_get_name(struct pipe_screen *screen)
|
|
||||||
{
|
|
||||||
struct nv04_screen *nv04screen = nv04_screen(screen);
|
|
||||||
struct nouveau_device *dev = nv04screen->nvws->channel->device;
|
|
||||||
static char buffer[128];
|
|
||||||
|
|
||||||
snprintf(buffer, sizeof(buffer), "NV%02X", dev->chipset);
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *
|
|
||||||
nv04_screen_get_vendor(struct pipe_screen *screen)
|
|
||||||
{
|
|
||||||
return "nouveau";
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
nv04_screen_get_param(struct pipe_screen *screen, int param)
|
nv04_screen_get_param(struct pipe_screen *screen, int param)
|
||||||
{
|
{
|
||||||
|
@ -144,18 +126,31 @@ struct pipe_screen *
|
||||||
nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
|
nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
|
||||||
{
|
{
|
||||||
struct nv04_screen *screen = CALLOC_STRUCT(nv04_screen);
|
struct nv04_screen *screen = CALLOC_STRUCT(nv04_screen);
|
||||||
|
struct nouveau_device *dev = nvws->channel->device;
|
||||||
|
struct pipe_screen *pscreen;
|
||||||
unsigned fahrenheit_class = 0, sub3d_class = 0;
|
unsigned fahrenheit_class = 0, sub3d_class = 0;
|
||||||
unsigned chipset = nvws->channel->device->chipset;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!screen)
|
if (!screen)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
pscreen = &screen->base.base;
|
||||||
|
|
||||||
screen->nvws = nvws;
|
screen->nvws = nvws;
|
||||||
|
|
||||||
if (chipset>=0x20) {
|
pscreen->winsys = ws;
|
||||||
|
pscreen->destroy = nv04_screen_destroy;
|
||||||
|
pscreen->get_param = nv04_screen_get_param;
|
||||||
|
pscreen->get_paramf = nv04_screen_get_paramf;
|
||||||
|
pscreen->is_format_supported = nv04_screen_is_format_supported;
|
||||||
|
|
||||||
|
nv04_screen_init_miptree_functions(pscreen);
|
||||||
|
nv04_screen_init_transfer_functions(pscreen);
|
||||||
|
nouveau_screen_init(&screen->base, dev);
|
||||||
|
|
||||||
|
if (dev->chipset >= 0x20) {
|
||||||
fahrenheit_class = 0;
|
fahrenheit_class = 0;
|
||||||
sub3d_class = 0;
|
sub3d_class = 0;
|
||||||
} else if (chipset>=0x10) {
|
} else if (dev->chipset >= 0x10) {
|
||||||
fahrenheit_class = NV10_DX5_TEXTURED_TRIANGLE;
|
fahrenheit_class = NV10_DX5_TEXTURED_TRIANGLE;
|
||||||
sub3d_class = NV10_CONTEXT_SURFACES_3D;
|
sub3d_class = NV10_CONTEXT_SURFACES_3D;
|
||||||
} else {
|
} else {
|
||||||
|
@ -164,7 +159,7 @@ nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fahrenheit_class) {
|
if (!fahrenheit_class) {
|
||||||
NOUVEAU_ERR("Unknown nv04 chipset: nv%02x\n", chipset);
|
NOUVEAU_ERR("Unknown nv04 chipset: nv%02x\n", dev->chipset);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,24 +185,10 @@ nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
|
||||||
ret = nvws->notifier_alloc(nvws, 1, &screen->sync);
|
ret = nvws->notifier_alloc(nvws, 1, &screen->sync);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
NOUVEAU_ERR("Error creating notifier object: %d\n", ret);
|
NOUVEAU_ERR("Error creating notifier object: %d\n", ret);
|
||||||
nv04_screen_destroy(&screen->pipe);
|
nv04_screen_destroy(pscreen);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
screen->pipe.winsys = ws;
|
return pscreen;
|
||||||
screen->pipe.destroy = nv04_screen_destroy;
|
|
||||||
|
|
||||||
screen->pipe.get_name = nv04_screen_get_name;
|
|
||||||
screen->pipe.get_vendor = nv04_screen_get_vendor;
|
|
||||||
screen->pipe.get_param = nv04_screen_get_param;
|
|
||||||
screen->pipe.get_paramf = nv04_screen_get_paramf;
|
|
||||||
|
|
||||||
screen->pipe.is_format_supported = nv04_screen_is_format_supported;
|
|
||||||
|
|
||||||
nv04_screen_init_miptree_functions(&screen->pipe);
|
|
||||||
nv04_screen_init_transfer_functions(&screen->pipe);
|
|
||||||
u_simple_screen_init(&screen->pipe);
|
|
||||||
|
|
||||||
return &screen->pipe;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#ifndef __NV04_SCREEN_H__
|
#ifndef __NV04_SCREEN_H__
|
||||||
#define __NV04_SCREEN_H__
|
#define __NV04_SCREEN_H__
|
||||||
|
|
||||||
#include "pipe/p_screen.h"
|
#include "nouveau/nouveau_screen.h"
|
||||||
#include "nv04_surface_2d.h"
|
#include "nv04_surface_2d.h"
|
||||||
|
|
||||||
struct nv04_screen {
|
struct nv04_screen {
|
||||||
struct pipe_screen pipe;
|
struct nouveau_screen base;
|
||||||
|
|
||||||
struct nouveau_winsys *nvws;
|
struct nouveau_winsys *nvws;
|
||||||
unsigned chipset;
|
unsigned chipset;
|
||||||
|
|
|
@ -99,8 +99,8 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx,
|
||||||
struct nouveau_channel *chan = ctx->nvws->channel;
|
struct nouveau_channel *chan = ctx->nvws->channel;
|
||||||
struct nouveau_grobj *swzsurf = ctx->swzsurf;
|
struct nouveau_grobj *swzsurf = ctx->swzsurf;
|
||||||
struct nouveau_grobj *sifm = ctx->sifm;
|
struct nouveau_grobj *sifm = ctx->sifm;
|
||||||
struct nouveau_bo *src_bo = ctx->nvws->get_bo(ctx->buf(src));
|
struct nouveau_bo *src_bo = nouveau_bo(ctx->buf(src));
|
||||||
struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst));
|
struct nouveau_bo *dst_bo = nouveau_bo(ctx->buf(dst));
|
||||||
const unsigned src_pitch = ((struct nv04_surface *)src)->pitch;
|
const unsigned src_pitch = ((struct nv04_surface *)src)->pitch;
|
||||||
const unsigned max_w = 1024;
|
const unsigned max_w = 1024;
|
||||||
const unsigned max_h = 1024;
|
const unsigned max_h = 1024;
|
||||||
|
@ -169,8 +169,8 @@ nv04_surface_copy_m2mf(struct nv04_surface_2d *ctx,
|
||||||
{
|
{
|
||||||
struct nouveau_channel *chan = ctx->nvws->channel;
|
struct nouveau_channel *chan = ctx->nvws->channel;
|
||||||
struct nouveau_grobj *m2mf = ctx->m2mf;
|
struct nouveau_grobj *m2mf = ctx->m2mf;
|
||||||
struct nouveau_bo *src_bo = ctx->nvws->get_bo(ctx->buf(src));
|
struct nouveau_bo *src_bo = nouveau_bo(ctx->buf(src));
|
||||||
struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst));
|
struct nouveau_bo *dst_bo = nouveau_bo(ctx->buf(dst));
|
||||||
unsigned src_pitch = ((struct nv04_surface *)src)->pitch;
|
unsigned src_pitch = ((struct nv04_surface *)src)->pitch;
|
||||||
unsigned dst_pitch = ((struct nv04_surface *)dst)->pitch;
|
unsigned dst_pitch = ((struct nv04_surface *)dst)->pitch;
|
||||||
unsigned dst_offset = dst->offset + dy * dst_pitch +
|
unsigned dst_offset = dst->offset + dy * dst_pitch +
|
||||||
|
@ -216,8 +216,8 @@ nv04_surface_copy_blit(struct nv04_surface_2d *ctx, struct pipe_surface *dst,
|
||||||
struct nouveau_channel *chan = ctx->nvws->channel;
|
struct nouveau_channel *chan = ctx->nvws->channel;
|
||||||
struct nouveau_grobj *surf2d = ctx->surf2d;
|
struct nouveau_grobj *surf2d = ctx->surf2d;
|
||||||
struct nouveau_grobj *blit = ctx->blit;
|
struct nouveau_grobj *blit = ctx->blit;
|
||||||
struct nouveau_bo *src_bo = ctx->nvws->get_bo(ctx->buf(src));
|
struct nouveau_bo *src_bo = nouveau_bo(ctx->buf(src));
|
||||||
struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst));
|
struct nouveau_bo *dst_bo = nouveau_bo(ctx->buf(dst));
|
||||||
unsigned src_pitch = ((struct nv04_surface *)src)->pitch;
|
unsigned src_pitch = ((struct nv04_surface *)src)->pitch;
|
||||||
unsigned dst_pitch = ((struct nv04_surface *)dst)->pitch;
|
unsigned dst_pitch = ((struct nv04_surface *)dst)->pitch;
|
||||||
int format;
|
int format;
|
||||||
|
@ -282,7 +282,7 @@ nv04_surface_fill(struct nv04_surface_2d *ctx, struct pipe_surface *dst,
|
||||||
struct nouveau_channel *chan = ctx->nvws->channel;
|
struct nouveau_channel *chan = ctx->nvws->channel;
|
||||||
struct nouveau_grobj *surf2d = ctx->surf2d;
|
struct nouveau_grobj *surf2d = ctx->surf2d;
|
||||||
struct nouveau_grobj *rect = ctx->rect;
|
struct nouveau_grobj *rect = ctx->rect;
|
||||||
struct nouveau_bo *dst_bo = ctx->nvws->get_bo(ctx->buf(dst));
|
struct nouveau_bo *dst_bo = nouveau_bo(ctx->buf(dst));
|
||||||
unsigned dst_pitch = ((struct nv04_surface *)dst)->pitch;
|
unsigned dst_pitch = ((struct nv04_surface *)dst)->pitch;
|
||||||
int cs2d_format, gdirect_format;
|
int cs2d_format, gdirect_format;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue