2 Copyright 2019, The AROS Development Team. All rights reserved.
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"
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
));
39 VMWareSVGA_WSSurf_SurfaceUnMap(struct svga_winsys_context
*swc
,
40 struct svga_winsys_surface
*srf
,
43 struct HIDDGalliumVMWareSVGASurf
*surface
= VMWareSVGA_WSSurf_HiddSurfFromWinSysSurf(srf
);
45 D(bug("[VMWareSVGA:Gallium] %s(0x%p, 0x%p)\n", __func__
, swc
, surface
));
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.
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
)
78 src_ref
= src
? &src
->refcnt
: NULL
;
79 dst_ref
= dst
? &dst
->refcnt
: NULL
;
81 if (pipe_reference(dst_ref
, src_ref
)) {
84 VMWareSVGA_WSSurf_buffer_destroy(&dst
->screen
->base
, dst
->buf
);