Commit graph

47 commits

Author SHA1 Message Date
Chris Wilson
c7511fa7ad drm/intel: Revoke glyph caches on device finish 2010-03-22 17:21:38 +00:00
Chris Wilson
7812d095ab drm/intel: Replace open-coding of _cairo_rtree_node_remove() 2010-03-22 16:46:58 +00:00
Chris Wilson
e961cdf568 image: Special case wholly unbounded fixups.
In the event of an empty bounded rectangle, the computation of the
unbounded - bounded rectangles leads to negative areas, integer overflow
and death.

[And similarly for the derived surfaces.]
2010-03-22 10:54:08 +00:00
Chris Wilson
5fb36fe5ab drm/i965: Acquire device around commit. 2010-03-08 15:37:17 +00:00
Chris Wilson
f79b2ceea4 drm/i915: Discard redundant solitary clips during fill 2010-03-04 19:52:58 +00:00
Chris Wilson
7cea9ae290 drm/i915: Apply more micro-optimisations when targetting CONTENT_ALPHA 2010-03-04 17:23:55 +00:00
Chris Wilson
dce8b028cd drm/i915: Adjust clip matrix for clip origin. 2010-03-04 17:13:53 +00:00
Chris Wilson
8e702044b3 drm/i915: Handle clip/combine coords for spans. 2010-03-04 17:13:02 +00:00
Chris Wilson
afe6f4f051 drm/i915: Use a preserved temporary to store the radial texcoord. 2010-03-04 00:04:30 +00:00
Chris Wilson
4b2e047882 drm/i915: Eliminate redundant radial vertex shader.
It is always equivalent to a simple texture transformation, so reduce it
to the texture shader.
2010-03-04 00:04:30 +00:00
Chris Wilson
5161051798 drm/i915: Fix encoding of negated operand channels
Long ago when converting the pixel shader structs into macros and
reducing the code size by ~100k (the inlines were too depth for constant
propagation and CSE), I broke the encoding of negated channels. So
instead use a single bit to indicate a negation rather than 2s
complement (with sign extension into neighbouring channels, oops). The
disadvantage is that expressing the negated channel is a little more
ugly.
2010-03-04 00:04:30 +00:00
Chris Wilson
5b973c6708 drm/i915: Fix crash with linear-step-function
Avoid the potential divide by zero by falling back to pixman rendered
gradient textures for such troublesome input.
2010-03-04 00:04:30 +00:00
Chris Wilson
404ead7eeb drm/i915: Ensure simple alpha is written to green on alpha-only surfaces.
The intricacies of h/w make convoluted s/w.
2010-03-04 00:04:30 +00:00
Chris Wilson
1f2daf6524 drm/i915: Avoid double multiplication of linear alpha. 2010-03-04 00:04:21 +00:00
Chris Wilson
cdaef58c19 drm/i915: Acquire device before shader commit. 2010-03-03 23:57:36 +00:00
Chris Wilson
dd6f96dd4a drm/i965: Ignore flushing on device finish. 2010-03-03 23:57:36 +00:00
Chris Wilson
3692597567 drm/i965: Merge the constants into the surface stream.
As we can use an offset from the surface base for the constant buffers,
we need to fold the constants into the surface stream.
2010-03-03 23:57:35 +00:00
Chris Wilson
cc58594757 drm/intel: Set the 1D gradient texture to be untiled. 2010-03-03 23:57:35 +00:00
Chris Wilson
543cf07364 drm/intel: Set default extend mode for rendering gradient subsets. 2010-03-03 23:57:35 +00:00
Chris Wilson
e8c819c522 Warnings cleanup for CAIRO_FORMAT_INVALID.
A few more fixes required case statements to handle the addition of
CAIRO_FORMAT_INVALID.
2010-03-01 10:25:01 +00:00
M Joonas Pihlaja
5b7f4bb241 api: Introduce CAIRO_FORMAT_INVALID formally in the API.
We were exposing the actual value of CAIRO_FORMAT_INVALID
through API functions already, so it makes sense to just
go ahead and put it in the cairo_format_t enum.
2010-03-01 01:21:31 +02:00
Chris Wilson
3b678a88b0 drm/i915: Set a source for unbounded fixups. 2010-02-12 16:44:44 +00:00
Chris Wilson
45a275ee29 drm/i915: Use correct linear mode for mask. 2010-02-12 14:12:24 +00:00
Chris Wilson
5390df961f clip: Restrict composite extents to clip extents
Fixes test/clip-rectangle-twice.
2010-02-12 12:24:01 +00:00
Chris Wilson
4113e455a3 drm/i965: fix use of uninitialized variable whilst dumping errors
Cut'n'paste bug from i915 error path.
2010-02-10 21:09:56 +00:00
Chris Wilson
fb5af4ae40 drm/intel: An interrupted SET_TILING modifies the input parameters
If a signal interrupts the SET_TILING ioctl, the tiling and stride
values are updated to reflect the current condition of the buffer, so we
need to restore those to the desired values before repeating the ioctl.
2010-02-10 12:00:59 +00:00
Chris Wilson
597dd24ddc drm/i915: Free potential leak of cloned textures. 2010-02-03 09:13:20 +00:00
Chris Wilson
913a31494e drm/i915: Increase batch buffer space. 2010-02-03 09:13:20 +00:00
Chris Wilson
1315323b20 drm/i915: check for batch buffer overflow.
Oops, the check for sufficient batch space mysteriously disappeared
during the rearrangement.
2010-02-03 09:13:20 +00:00
Chris Wilson
e9b07d1946 drm/i915: Don't tile page sized bo.
Minor tweak from < to <= so that a page sized bo is also not tiled for
those 32x32 pixmaps...
2010-02-02 16:31:36 +00:00
Chris Wilson
70ca9dd170 drm/i915: Pass the correct length to dump the batchbuffer. 2010-02-02 16:31:36 +00:00
Chris Wilson
3266a1a72b drm: Handle absence of PCI_ID 2010-02-02 16:31:36 +00:00
Chris Wilson
5f0a0088af drm-intel: Unmap a full glyph cache.
When we swap a full glyph cache for a fresh one, be sure to unmap the
old one prior to release.
2010-01-28 13:23:39 +00:00
Chris Wilson
78cd947120 drm: Paranoid assert that the fallback is released upon finish. 2010-01-27 23:45:17 +00:00
Chris Wilson
5aa1191204 drm-intel: flush in memory modifications to texture.
If the surface was written to using a fallback, and so is mapped, we
need to flush those modifications by relinquishing the map. So the next
time the application tries to write to the surface, those writes are
correctly serialised with our reads.
2010-01-27 23:42:26 +00:00
Chris Wilson
a38accb694 drm-intel: The accumulation bo may be NULL, beware.
If we are not accumulating but rendering directly to the output vbo,
then the tail bo may not even be allocated, let alone mapped.
2010-01-27 23:27:46 +00:00
Chris Wilson
44734b9d3b drm-intel: Assert that the bo is unmapped upon release.
Check through error paths to catch a few more places where the mapped bo
may have been leaked, and add an assert to abort in case we do leak a
mapping.
2010-01-27 23:17:44 +00:00
Chris Wilson
6848c7c850 drm-i915: Don't tile temporary image textures.
As uploading to a tiled buffer is much slower than linear memory, don't
unless we expect to reuse the texture. This is not true for sub-image
clones, which are single shot affairs.
2010-01-27 23:01:37 +00:00
Chris Wilson
f75b7c4c11 drm/i915: Ensure surface is initialized.
Let's try that again, this time remembering to place it on the
conjunction of the two branches, so *both* paths are initialized.
2010-01-27 19:23:07 +00:00
Chris Wilson
02f20458d1 drm-i915: Ensure surface size for clone is initialized.
If the surface had a snapshot, then we would have not initialized the
surface size and so compute a bogus normalization matrix.
2010-01-27 19:02:21 +00:00
Chris Wilson
6d2d338ac0 drm: compile fix for cairo_always_inline
s/always_inline/cairo_always_inline/
2010-01-27 17:55:28 +00:00
Chris Wilson
77afe8491e drm: Add backends for i915 and i965.
As proof-of-principle add the nearly working demonstrations of using DRM
to render directly with the GPU bypassing both RENDER and GL for
performance whilst preserving high quality rendering.

The basis behind developing these chip specific backends is that this is
the idealised interface that we desire for this chips, and so a target
for cairo-gl as we continue to develop both it and our GL stack.

Note that this backends do not yet fully pass the test suite, so only
use if you are brave and willing to help develop them further.
2010-01-22 23:01:52 +00:00
Chris Wilson
f617d5fc98 Add cairo_device_t
The device is a generic method for accessing the underlying interface
with the native graphics subsystem, typically the X connection or
perhaps the GL context. By exposing a cairo_device_t on a surface and
its various methods we enable finer control over interoperability with
external interactions of the device by applications. The use case in
mind is, for example, a multi-threaded gstreamer which needs to serialise
its own direct access to the device along with Cairo's across many
threads.

Secondly, the cairo_device_t is a unifying API for the mismash of
backend specific methods for controlling creation of surfaces with
explicit devices and a convenient hook for debugging and introspection.

The principal components of the API are the memory management of:

  cairo_device_reference(),
  cairo_device_finish() and
  cairo_device_destroy();

along with a pair of routines for serialising interaction:

  cairo_device_acquire() and
  cairo_device_release()

and a method to flush any outstanding accesses:

  cairo_device_flush().

The device for a particular surface may be retrieved using:

  cairo_surface_get_device().

The device returned is owned by the surface.
2010-01-22 23:01:50 +00:00
Chris Wilson
6b3e19aa43 Remove content matching from snapshot lookup.
This was never used, so remove the complexity from the interface.
2010-01-22 23:01:50 +00:00
Chris Wilson
cfd204824f Constify stroke style and matrices.
As a simple step to ensure that we do not inadvertently modify (or at least
generate compiler warns if we try) user data, mark the incoming style
and matrices as constant.
2010-01-22 23:01:49 +00:00
Chris Wilson
c50c8b90c0 Move _cairo_error() to a standalone header
A pending commit will want to include some utility code from cairo and
so we need to extricate the error handling from the PLT symbol hiding.
2010-01-22 22:30:43 +00:00
Chris Wilson
c3f2db4f73 [drm] Add an accelerated image surface.
Use the DRM interface to h/w accelerate composition on image surfaces.
The purpose of the backend is simply to explore what such a hardware
interface might look like and what benefits we might expect.  The
use case that might justify writing such custom backends are embedded
devices running a drm compositor like wayland - which would, for example,
allow one to write applications that seamlessly integrated accelerated,
dynamic, high quality 2D graphics using Cairo with advanced interaction
(e.g. smooth animations in the UI) driven by a clutter framework...

In this first step we introduce the fundamental wrapping of GEM for intel
and radeon chipsets, and, for comparison, gallium. No acceleration, all
we do is use buffer objects (that is use the kernel memory manager) to
allocate images and simply use the fallback mechanism. This provides a
suitable base to start writing chip specific drivers.
2009-07-23 16:18:42 +01:00