~ubuntu-branches/ubuntu/precise/xorg-server/precise

« back to all changes in this revision

Viewing changes to randr/rrsprite.c

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2011-01-31 19:45:19 UTC
  • mfrom: (1.1.38 upstream) (0.1.19 experimental)
  • Revision ID: james.westby@ubuntu.com-20110131194519-fx30d1zsg83invba
Tags: 2:1.9.99.901+git20110131.be3be758-0ubuntu1
* Merge from (unreleased) debian-experimental.  Remaining Ubuntu changes:
  - rules:
    + Disable SELinux, libaudit-dev is not in main yet. (LP: #406226)
    + Enable xcsecurity. (LP: #247537)
    + Add --with-extra-module-dir to support GL alternatives.
  - control: 
    + Xvfb depends on xauth, x11-xkb-utils. (LP: #500102)
    + Add breaks for incompatible drivers. (LP: #614993)
    + Drop libaudit-dev from build-deps.
  - local/xvfb-run*: Add correct docs about error codes. (LP #328205)
  - debian/patches:
    + 100_rethrow_signals.patch:
      When aborting, re-raise signals for apport
    + 109_fix-swcursor-crash.patch:
      Avoid dereferencing null pointer while reloading cursors during
      resume. (LP: #371405)
    + 111_armel-drv-fallbacks.patch:
      Add support for armel driver fallbacks.
    + 121_only_switch_vt_when_active.diff:
      Add a check to prevent the X server from changing the VT when killing
      GDM from the console.
    + 122_xext_fix_card32_overflow_in_xauth.patch:
      Fix server crash when “xauth generate” is called with large timeout.
    + 157_check_null_modes.patch, 162_null_crtc_in_rotation.patch,
      166_nullptr_xinerama_keyrepeat.patch, 167_nullptr_xisbread.patch
      169_mipointer_nullptr_checks.patch,
      172_cwgetbackingpicture_nullptr_check.patch:
      Fix various segfaults in xserver by checking pointers for NULL
      values before dereferencing them.
    + 165_man_xorg_conf_no_device_ident.patch
      Correct man page
    + 168_glibc_trace_to_stderr.patch:
      Report abort traces to stderr instead of terminal
    + 184_virtual_devices_autodetect.patch:
      Use vesa for qemu device, which is not supported by cirrus
    + 188_default_primary_to_first_busid.patch:
      Pick the first device and carry on (LP: #459512)
    + 190_cache-xkbcomp_output_for_fast_start_up.patch:
    + 191-Xorg-add-an-extra-module-path.patch:
      Add support for the alternatives module path.
    + 198_nohwaccess.patch:
      Adds a -nohwaccess argument to make X not access the hardware
      ports directly.
    + 200_randr-null.patch:
      Clarify a pointer initialization.
    + 206_intel_8xx_default_to_fbdev.patch:
      Makes 8xx class intel GPUs default to fbdev for stability. (LP: #633593)
* Refresh 121_only_switch_vt_when_active.diff for new upstream.
* Drop 187_edid_quirk_hp_nc8430.patch; upstream.
* Drop 189_xserver_1.5.0_bg_none_root.patch; functionality now upstream.
* Refresh 190_cache-xkbcomp_output_for_fast_start_up.patch for new upstream.
* Drop 197_xvfb-randr.patch:
  - miRandR, which this used, has been removed from the server. 
* Drop 204_fix-neg-sync-transition.patch; upstream.
* Drop 207_dga_master_device.patch; upstream.
* Drop 208_switch_on_release.diff; upstream.
* debian/patches/209_add_legacy_bgnone_option.patch:
  - Add "-nr" as a synonym for "-background none" to ease the transition from
    the old 189_xserver_1.5.0_bg_none_root.patch patch.  Can be dropped once
    all the ?DM have been updated to use the new option.
* debian/control:
  - Add Breaks: to xserver-xorg-video-8 and current fglrx.  These proprietary
    drivers don't yet have appropriate dependency information, so manually
    handle them here to prevent broken upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2010 Keith Packard
 
3
 *
 
4
 * Permission to use, copy, modify, distribute, and sell this software and its
 
5
 * documentation for any purpose is hereby granted without fee, provided that
 
6
 * the above copyright notice appear in all copies and that both that copyright
 
7
 * notice and this permission notice appear in supporting documentation, and
 
8
 * that the name of the copyright holders not be used in advertising or
 
9
 * publicity pertaining to distribution of the software without specific,
 
10
 * written prior permission.  The copyright holders make no representations
 
11
 * about the suitability of this software for any purpose.  It is provided "as
 
12
 * is" without express or implied warranty.
 
13
 *
 
14
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 
15
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 
16
 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 
17
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 
18
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 
19
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
 
20
 * OF THIS SOFTWARE.
 
21
 */
 
22
 
 
23
#include "randrstr.h"
 
24
#include "swaprep.h"
 
25
 
 
26
void
 
27
RRCrtcSpriteTransformSet(RRCrtcPtr crtc,
 
28
                         PictTransform *position_transform,
 
29
                         PictTransform *image_transform,
 
30
                         struct pict_f_transform *f_position_transform,
 
31
                         struct pict_f_transform *f_image_transform)
 
32
{
 
33
    ScreenPtr                   pScreen;
 
34
    rrScrPrivPtr                pScrPriv;
 
35
 
 
36
    pScreen = crtc->pScreen;
 
37
    pScrPriv = rrGetScrPriv(pScreen);
 
38
    crtc->client_sprite_position_transform = *position_transform;
 
39
    crtc->client_sprite_image_transform = *image_transform;
 
40
    crtc->client_sprite_f_position_transform = *f_position_transform;
 
41
    crtc->client_sprite_f_image_transform = *f_image_transform;
 
42
    if (pScrPriv->rrSetCrtcSpriteTransform)
 
43
        (*pScrPriv->rrSetCrtcSpriteTransform) (pScreen, crtc,
 
44
                                               &crtc->client_sprite_f_position_transform,
 
45
                                               &crtc->client_sprite_f_image_transform);
 
46
}
 
47
 
 
48
int
 
49
ProcRRSetCrtcSpriteTransform (ClientPtr client)
 
50
{
 
51
    REQUEST(xRRSetCrtcSpriteTransformReq);
 
52
    RRCrtcPtr               crtc;
 
53
    PictTransform           position_transform, image_transform;
 
54
    struct pixman_f_transform f_position_transform, f_image_transform;
 
55
 
 
56
    REQUEST_AT_LEAST_SIZE(xRRSetCrtcSpriteTransformReq);
 
57
    VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
 
58
 
 
59
    PictTransform_from_xRenderTransform (&position_transform, &stuff->positionTransform);
 
60
    PictTransform_from_xRenderTransform (&image_transform, &stuff->imageTransform);
 
61
    pixman_f_transform_from_pixman_transform (&f_position_transform, &position_transform);
 
62
    pixman_f_transform_from_pixman_transform (&f_image_transform, &image_transform);
 
63
 
 
64
    RRCrtcSpriteTransformSet (crtc, &position_transform, &image_transform,
 
65
                              &f_position_transform, &f_image_transform);
 
66
    return Success;
 
67
}
 
68
 
 
69
#define CrtcSpriteTransformExtra        (SIZEOF(xRRGetCrtcSpriteTransformReply) - 32)
 
70
 
 
71
int
 
72
ProcRRGetCrtcSpriteTransform (ClientPtr client)
 
73
{
 
74
    REQUEST(xRRGetCrtcSpriteTransformReq);
 
75
    xRRGetCrtcSpriteTransformReply      *reply;
 
76
    RRCrtcPtr                   crtc;
 
77
    int                         n;
 
78
    char                        *extra;
 
79
 
 
80
    REQUEST_SIZE_MATCH (xRRGetCrtcSpriteTransformReq);
 
81
    VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
 
82
 
 
83
    reply = malloc(sizeof (xRRGetCrtcSpriteTransformReply));
 
84
    if (!reply)
 
85
        return BadAlloc;
 
86
 
 
87
    extra = (char *) (reply + 1);
 
88
    reply->type = X_Reply;
 
89
    reply->sequenceNumber = client->sequence;
 
90
    reply->length = bytes_to_int32(CrtcSpriteTransformExtra);
 
91
 
 
92
    xRenderTransform_from_PictTransform(&reply->positionTransform, &crtc->client_sprite_position_transform);
 
93
    xRenderTransform_from_PictTransform(&reply->imageTransform, &crtc->client_sprite_image_transform);
 
94
 
 
95
    if (client->swapped) {
 
96
        swaps (&reply->sequenceNumber, n);
 
97
        swapl (&reply->length, n);
 
98
        SwapLongs((CARD32 *) &reply->positionTransform, bytes_to_int32(sizeof(xRenderTransform)));
 
99
        SwapLongs((CARD32 *) &reply->imageTransform, bytes_to_int32(sizeof(xRenderTransform)));
 
100
    }
 
101
    WriteToClient (client, sizeof (xRRGetCrtcSpriteTransformReply), (char *) reply);
 
102
    free(reply);
 
103
    return Success;
 
104
}