add place-holder directory for the a3000 wd533c93 scsi controller implementation.
[AROS.git] / workbench / hidds / vmwaresvga / vmwaresvga_gallium_surf.c
blob9b8f685963f456b610714638f144ced6ce57d085
1 /*
2 Copyright 2019, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/debug.h>
8 #include <proto/exec.h>
9 #include <proto/graphics.h>
10 #include <proto/utility.h>
11 #include <proto/oop.h>
13 #include <aros/libcall.h>
14 #include <aros/asmcall.h>
15 #include <aros/symbolsets.h>
16 #include <utility/tagitem.h>
18 #include <hidd/gallium.h>
19 #include <gallium/gallium.h>
21 #include "vmwaresvga_intern.h"
23 void *
24 VMWareSVGA_WSSurf_SurfaceMap(struct svga_winsys_context *swc,
25 struct svga_winsys_surface *srf,
26 unsigned flags, boolean *retry)
28 struct HIDDGalliumVMWareSVGASurf *surface = VMWareSVGA_WSSurf_HiddSurfFromWinSysSurf(srf);
29 void *data = (void *)((struct VMWareSVGAPBBuf *)(surface->surfbuf))->map;
31 D(bug("[VMWareSVGA:Gallium] %s(0x%p, 0x%p)\n", __func__, swc, surface));
32 D(bug("[VMWareSVGA:Gallium] %s: returning 0x%p\n", __func__, data));
34 return data;
38 void
39 VMWareSVGA_WSSurf_SurfaceUnMap(struct svga_winsys_context *swc,
40 struct svga_winsys_surface *srf,
41 boolean *rebind)
43 struct HIDDGalliumVMWareSVGASurf *surface = VMWareSVGA_WSSurf_HiddSurfFromWinSysSurf(srf);
45 D(bug("[VMWareSVGA:Gallium] %s(0x%p, 0x%p)\n", __func__, swc, surface));
48 enum pipe_error
49 VMWareSVGA_WSSurf_SurfaceInvalidate(struct svga_winsys_context *swc,
50 struct svga_winsys_surface *surf)
52 D(bug("[VMWareSVGA:Gallium] %s(0x%p)\n", __func__, swc));
54 /* this is a noop since surface invalidation is not needed for DMA path.
55 * DMA is enabled when guest-backed surface is not enabled or
56 * guest-backed dma is enabled. Since guest-backed dma is enabled
57 * when guest-backed surface is enabled, that implies DMA is always enabled;
58 * hence, surface invalidation is not needed.
60 return PIPE_OK;
63 void
64 VMWareSVGA_WSSurf_SurfaceReference(struct HIDDGalliumVMWareSVGASurf **pdst,
65 struct HIDDGalliumVMWareSVGASurf *src)
67 struct pipe_reference *src_ref;
68 struct pipe_reference *dst_ref;
69 struct HIDDGalliumVMWareSVGASurf *dst;
71 D(bug("[VMWareSVGA:Gallium] %s(0x%p, 0x%p)\n", __func__, pdst, src));
73 if(pdst == NULL || *pdst == src)
74 return;
76 dst = *pdst;
78 src_ref = src ? &src->refcnt : NULL;
79 dst_ref = dst ? &dst->refcnt : NULL;
81 if (pipe_reference(dst_ref, src_ref)) {
82 #if (0)
83 if (dst->buf)
84 VMWareSVGA_WSSurf_buffer_destroy(&dst->screen->base, dst->buf);
85 #endif
86 FREE(dst);
89 *pdst = src;