~ubuntu-branches/ubuntu/natty/mesa/natty-proposed

« back to all changes in this revision

Viewing changes to src/gallium/auxiliary/util/u_transfer.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker, Robert Hooker, Christopher James Halse Rogers
  • Date: 2010-09-14 08:55:40 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100914085540-m4fpl0hdjlfd4jgz
Tags: 7.9~git20100909-0ubuntu1
[ Robert Hooker ]
* New upstream git snapshot up to commit 94118fe2d4b1e5 (LP: #631413)
* New features include ATI HD5xxx series support in r600, and a vastly
  improved glsl compiler.
* Remove pre-generated .pc's, use the ones generated at build time
  instead.
* Remove all references to mesa-utils now that its no longer shipped
  with the mesa source.
* Disable the experimental ARB_fragment_shader option by default on
  i915, it exposes incomplete functionality that breaks KDE compositing
  among other things. It can be enabled via driconf still. (LP: #628930).

[ Christopher James Halse Rogers ]
* debian/patches/04_osmesa_version.diff:
  - Refresh for new upstream
* Bugs fixed in this release:
  - Fixes severe rendering corruption in Unity on radeon (LP: #628727,
    LP: #596292, LP: #599741, LP: #630315, LP: #613694, LP: #599741).
  - Also fixes rendering in gnome-shell (LP: #578619).
  - Flickering in OpenGL apps on radeon (LP: #626943, LP: #610541).
  - Provides preliminary support for new intel chips (LP: #601052).
* debian/rules:
  - Update configure flags to match upstream reshuffling.
  - Explicitly remove gallium DRI drivers that we don't want to ship.
* Update debian/gbp.conf for this Maverick-specific packaging
* libegl1-mesa-dri-x11,kms: There are no longer separate kms or x11 drivers
  for EGL, libegl1-mesa-drivers now contains a single driver that provides
  both backends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "pipe/p_context.h"
 
2
#include "util/u_rect.h"
 
3
#include "util/u_inlines.h"
 
4
#include "util/u_transfer.h"
 
5
#include "util/u_memory.h"
 
6
 
 
7
/* One-shot transfer operation with data supplied in a user
 
8
 * pointer.  XXX: strides??
 
9
 */
 
10
void u_default_transfer_inline_write( struct pipe_context *pipe,
 
11
                                      struct pipe_resource *resource,
 
12
                                      struct pipe_subresource sr,
 
13
                                      unsigned usage,
 
14
                                      const struct pipe_box *box,
 
15
                                      const void *data,
 
16
                                      unsigned stride,
 
17
                                      unsigned slice_stride)
 
18
{
 
19
   struct pipe_transfer *transfer = NULL;
 
20
   uint8_t *map = NULL;
 
21
 
 
22
   transfer = pipe->get_transfer(pipe, 
 
23
                                 resource,
 
24
                                 sr,
 
25
                                 usage,
 
26
                                 box );
 
27
   if (transfer == NULL)
 
28
      goto out;
 
29
 
 
30
   map = pipe_transfer_map(pipe, transfer);
 
31
   if (map == NULL)
 
32
      goto out;
 
33
 
 
34
   assert(box->depth == 1);     /* XXX: fix me */
 
35
   
 
36
   util_copy_rect(map,
 
37
                  resource->format,
 
38
                  transfer->stride, /* bytes */
 
39
                  0, 0,
 
40
                  box->width,
 
41
                  box->height,
 
42
                  data,
 
43
                  stride,       /* bytes */
 
44
                  0, 0);
 
45
 
 
46
out:
 
47
   if (map)
 
48
      pipe_transfer_unmap(pipe, transfer);
 
49
 
 
50
   if (transfer)
 
51
      pipe_transfer_destroy(pipe, transfer);
 
52
}
 
53
 
 
54
 
 
55
boolean u_default_resource_get_handle(struct pipe_screen *screen,
 
56
                                      struct pipe_resource *resource,
 
57
                                      struct winsys_handle *handle)
 
58
{
 
59
   return FALSE;
 
60
}
 
61
 
 
62
 
 
63
 
 
64
void u_default_transfer_flush_region( struct pipe_context *pipe,
 
65
                                      struct pipe_transfer *transfer,
 
66
                                      const struct pipe_box *box)
 
67
{
 
68
   /* This is a no-op implementation, nothing to do.
 
69
    */
 
70
}
 
71
 
 
72
unsigned u_default_is_resource_referenced( struct pipe_context *pipe,
 
73
                                           struct pipe_resource *resource,
 
74
                                        unsigned face, unsigned level)
 
75
{
 
76
   return 0;
 
77
}
 
78
 
 
79
struct pipe_transfer * u_default_get_transfer(struct pipe_context *context,
 
80
                                              struct pipe_resource *resource,
 
81
                                              struct pipe_subresource sr,
 
82
                                              unsigned usage,
 
83
                                              const struct pipe_box *box)
 
84
{
 
85
   struct pipe_transfer *transfer = CALLOC_STRUCT(pipe_transfer);
 
86
   if (transfer == NULL)
 
87
      return NULL;
 
88
 
 
89
   transfer->resource = resource;
 
90
   transfer->sr = sr;
 
91
   transfer->usage = usage;
 
92
   transfer->box = *box;
 
93
 
 
94
   /* Note strides are zero, this is ok for buffers, but not for
 
95
    * textures 2d & higher at least. 
 
96
    */
 
97
   return transfer;
 
98
}
 
99
 
 
100
void u_default_transfer_unmap( struct pipe_context *pipe,
 
101
                              struct pipe_transfer *transfer )
 
102
{
 
103
}
 
104
 
 
105
void u_default_transfer_destroy(struct pipe_context *pipe,
 
106
                                struct pipe_transfer *transfer)
 
107
{
 
108
   FREE(transfer);
 
109
}
 
110