Its only purpose was to destroy itself.
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(C_SOURCES)
-LOCAL_C_INCLUDES := $(DRM_TOP)
+LOCAL_C_INCLUDES := $(DRM_TOP) \
+ $(DRM_TOP)/include/drm \
+ $(DRM_TOP)/nouveau
LOCAL_MODULE := libmesa_pipe_nouveau
$(LIBDRM_CFLAGS) \
-I$(TOP)/src/gallium/drivers/nouveau/include
+LIBRARY_INCLUDES += $(shell $(PKG_CONFIG) libdrm libdrm_nouveau --cflags-only-I)
+LIBRARY_DEFINES += $(shell $(PKG_CONFIG) libdrm libdrm_nouveau --cflags-only-other)
+
# get C_SOURCES
include Makefile.sources
#include "state_tracker/drm_driver.h"
#include "util/u_simple_screen.h"
+#include "nouveau_drmif.h"
+
int nouveau_mesa_debug = 0;
static const char *
void
nouveau_screen_fini(struct nouveau_screen *screen)
{
- struct pipe_winsys *ws = screen->base.winsys;
-
nouveau_mm_destroy(screen->mm_GART);
nouveau_mm_destroy(screen->mm_VRAM);
nouveau_channel_free(&screen->channel);
- if (ws)
- ws->destroy(ws);
+ nouveau_device_close(&screen->device);
}
}
extern struct pipe_screen *
-nvfx_screen_create(struct pipe_winsys *ws, struct nouveau_device *);
+nvfx_screen_create(struct nouveau_device *);
extern struct pipe_screen *
-nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *);
+nv50_screen_create(struct nouveau_device *);
extern struct pipe_screen *
-nvc0_screen_create(struct pipe_winsys *ws, struct nouveau_device *);
+nvc0_screen_create(struct nouveau_device *);
#endif
struct pipe_context *
nv50_create(struct pipe_screen *pscreen, void *priv)
{
- struct pipe_winsys *pipe_winsys = pscreen->winsys;
struct nv50_screen *screen = nv50_screen(pscreen);
struct nv50_context *nv50;
struct pipe_context *pipe;
nv50->base.copy_data = nv50_m2mf_copy_linear;
nv50->base.push_data = nv50_sifc_linear_u8;
- pipe->winsys = pipe_winsys;
pipe->screen = pscreen;
pipe->priv = priv;
} while(0)
struct pipe_screen *
-nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
+nv50_screen_create(struct nouveau_device *dev)
{
struct nv50_screen *screen;
struct nouveau_channel *chan;
chan = screen->base.channel;
chan->user_private = screen;
- pscreen->winsys = ws;
pscreen->destroy = nv50_screen_destroy;
pscreen->context_create = nv50_create;
pscreen->is_format_supported = nv50_screen_is_format_supported;
struct nv50_screen {
struct nouveau_screen base;
- struct nouveau_winsys *nvws;
struct nv50_context *cur_ctx;
struct pipe_context *
nvc0_create(struct pipe_screen *pscreen, void *priv)
{
- struct pipe_winsys *pipe_winsys = pscreen->winsys;
struct nvc0_screen *screen = nvc0_screen(pscreen);
struct nvc0_context *nvc0;
struct pipe_context *pipe;
nvc0->base.push_data = nvc0_m2mf_push_linear;
nvc0->base.push_cb = nvc0_cb_push;
- pipe->winsys = pipe_winsys;
pipe->screen = pscreen;
pipe->priv = priv;
} while(0)
struct pipe_screen *
-nvc0_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
+nvc0_screen_create(struct nouveau_device *dev)
{
struct nvc0_screen *screen;
struct nouveau_channel *chan;
chan = screen->base.channel;
chan->user_private = screen;
- pscreen->winsys = ws;
pscreen->destroy = nvc0_screen_destroy;
pscreen->context_create = nvc0_create;
pscreen->is_format_supported = nvc0_screen_is_format_supported;
struct nvc0_screen {
struct nouveau_screen base;
- struct nouveau_winsys *nvws;
struct nvc0_context *cur_ctx;
nvfx_create(struct pipe_screen *pscreen, void *priv)
{
struct nvfx_screen *screen = nvfx_screen(pscreen);
- struct pipe_winsys *ws = pscreen->winsys;
struct nvfx_context *nvfx;
- struct nouveau_winsys *nvws = screen->nvws;
nvfx = CALLOC(1, sizeof(struct nvfx_context));
if (!nvfx)
return NULL;
nvfx->screen = screen;
- nvfx->nvws = nvws;
-
- nvfx->pipe.winsys = ws;
nvfx->pipe.screen = pscreen;
nvfx->pipe.priv = priv;
nvfx->pipe.destroy = nvfx_destroy;
struct nvfx_context {
struct pipe_context pipe;
- struct nouveau_winsys *nvws;
struct nvfx_screen *screen;
unsigned is_nv4x; /* either 0 or ~0 */
}
struct pipe_screen *
-nvfx_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
+nvfx_screen_create(struct nouveau_device *dev)
{
static const unsigned query_sizes[] = {(4096 - 4 * 32) / 32, 3 * 1024 / 32, 2 * 1024 / 32, 1024 / 32};
struct nvfx_screen *screen = CALLOC_STRUCT(nvfx_screen);
chan->user_private = screen;
chan->flush_notify = nvfx_channel_flush_notify;
- pscreen->winsys = ws;
pscreen->destroy = nvfx_screen_destroy;
pscreen->get_param = nvfx_screen_get_param;
pscreen->get_shader_param = nvfx_screen_get_shader_param;
struct nvfx_screen {
struct nouveau_screen base;
- struct nouveau_winsys *nvws;
struct nouveau_bo *fence;
struct nvfx_context *cur_ctx;
+++ /dev/null
-#ifndef _NOUVEAU_DRI_
-#define _NOUVEAU_DRI_
-
-#include "xf86drm.h"
-#include "drm.h"
-#include "nouveau_drm.h"
-
-struct nouveau_dri {
- uint32_t device_id; /**< \brief PCI device ID */
- uint32_t width; /**< \brief width in pixels of display */
- uint32_t height; /**< \brief height in scanlines of display */
- uint32_t depth; /**< \brief depth of display (8, 15, 16, 24) */
- uint32_t bpp; /**< \brief bit depth of display (8, 16, 24, 32) */
-
- uint32_t bus_type; /**< \brief ths bus type */
- uint32_t bus_mode; /**< \brief bus mode (used for AGP, maybe also for PCI-E ?) */
-
- uint32_t front_offset; /**< \brief front buffer offset */
- uint32_t front_pitch; /**< \brief front buffer pitch */
- uint32_t back_offset; /**< \brief private back buffer offset */
- uint32_t back_pitch; /**< \brief private back buffer pitch */
- uint32_t depth_offset; /**< \brief private depth buffer offset */
- uint32_t depth_pitch; /**< \brief private depth buffer pitch */
-
-};
-
-#endif
-
#include "util/u_memory.h"
#include "util/u_inlines.h"
-#include "nouveau_drm_winsys.h"
#include "nouveau_drm_public.h"
#include "nouveau_drmif.h"
#include "nouveau/nouveau_winsys.h"
#include "nouveau/nouveau_screen.h"
-static void
-nouveau_drm_destroy_winsys(struct pipe_winsys *s)
-{
- struct nouveau_winsys *nv_winsys = nouveau_winsys(s);
- struct nouveau_screen *nv_screen= nouveau_screen(nv_winsys->pscreen);
- if (nv_screen)
- nouveau_device_close(&nv_screen->device);
- FREE(nv_winsys);
-}
-
struct pipe_screen *
nouveau_drm_screen_create(int fd)
{
- struct nouveau_winsys *nvws;
- struct pipe_winsys *ws;
struct nouveau_device *dev = NULL;
- struct pipe_screen *(*init)(struct pipe_winsys *,
- struct nouveau_device *);
+ struct pipe_screen *(*init)(struct nouveau_device *);
int ret;
ret = nouveau_device_open_existing(&dev, 0, fd, 0);
return NULL;
}
- nvws = CALLOC_STRUCT(nouveau_winsys);
- if (!nvws) {
- nouveau_device_close(&dev);
- return NULL;
- }
- ws = &nvws->base;
- ws->destroy = nouveau_drm_destroy_winsys;
-
- nvws->pscreen = init(ws, dev);
- if (!nvws->pscreen) {
- ws->destroy(ws);
- return NULL;
- }
-
- return nvws->pscreen;
+ return init(dev);
}
+++ /dev/null
-#ifndef __NOUVEAU_DRM_WINSYS_H__
-#define __NOUVEAU_DRM_WINSYS_H__
-
-#include "util/u_simple_screen.h"
-
-#include "nouveau_dri.h"
-
-struct nouveau_winsys {
- struct pipe_winsys base;
-
- struct pipe_screen *pscreen;
-
- struct pipe_surface *front;
-};
-
-static INLINE struct nouveau_winsys *
-nouveau_winsys(struct pipe_winsys *ws)
-{
- return (struct nouveau_winsys *)ws;
-}
-
-static INLINE struct nouveau_winsys *
-nouveau_winsys_screen(struct pipe_screen *pscreen)
-{
- return nouveau_winsys(pscreen->winsys);
-}
-
-#endif