diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2009-03-18 08:22:35 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2009-03-18 09:44:40 +1000 |
commit | e00ae524e236afba1305150cacd634eaa1f5460b (patch) | |
tree | e6173fc3a85b6f6b66691e4a880257a39764fd6e /src/gallium/winsys/drm/nouveau/common/nouveau_winsys_softpipe.c | |
parent | b46fcf25be4d1d5a5d072fbce03c2490bf41203f (diff) |
nouveau: rewrite winsys in terms of drm_api, support dri2 state tracker
drm_api is a set of hooks used by the dri2 state tracker, this wraps our
dri1 code around the same set of hooks.
Currently the dri2 build will produce nouveau_dri2.so which you'll need
to install as nouveau_dri.so if you wish to try it. The dri2 state
tracker doesn't make it easy for a driver to support both paths in the
same binary.
Diffstat (limited to 'src/gallium/winsys/drm/nouveau/common/nouveau_winsys_softpipe.c')
-rw-r--r-- | src/gallium/winsys/drm/nouveau/common/nouveau_winsys_softpipe.c | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_softpipe.c b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_softpipe.c deleted file mode 100644 index 396e4f2a2e..0000000000 --- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys_softpipe.c +++ /dev/null @@ -1,101 +0,0 @@ -/************************************************************************** - * - * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ -/* - * Authors: Keith Whitwell <keithw-at-tungstengraphics-dot-com> - */ - -#include "pipe/internal/p_winsys_screen.h" -#include <pipe/p_screen.h> -#include <pipe/p_defines.h> -#include <pipe/p_format.h> -#include <softpipe/sp_winsys.h> -#include <util/u_memory.h> -#include "nouveau_context.h" -#include "nouveau_winsys_pipe.h" - -struct nouveau_softpipe_winsys { - struct softpipe_winsys sws; - struct nouveau_context *nv; -}; - -/** - * Return list of surface formats supported by this driver. - */ -static boolean -nouveau_is_format_supported(struct softpipe_winsys *sws, - enum pipe_format format) -{ - switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_R5G6B5_UNORM: - case PIPE_FORMAT_Z24S8_UNORM: - return TRUE; - default: - break; - }; - - return FALSE; -} - -struct pipe_context * -nouveau_create_softpipe(struct nouveau_context *nv) -{ - struct nouveau_softpipe_winsys *nvsws; - struct pipe_screen *pscreen; - struct pipe_winsys *ws; - struct pipe_context *pipe; - - ws = nouveau_create_pipe_winsys(nv); - if (!ws) - return NULL; - pscreen = softpipe_create_screen(ws); - if (!pscreen) { - ws->destroy(ws); - return NULL; - } - nvsws = CALLOC_STRUCT(nouveau_softpipe_winsys); - if (!nvsws) { - ws->destroy(ws); - pscreen->destroy(pscreen); - return NULL; - } - - nvsws->sws.is_format_supported = nouveau_is_format_supported; - nvsws->nv = nv; - - pipe = softpipe_create(pscreen, ws, &nvsws->sws); - if (!pipe) { - ws->destroy(ws); - pscreen->destroy(pscreen); - FREE(nvsws); - return NULL; - } - - return pipe; -} - |