~ubuntu-branches/ubuntu/maverick/xorg-server/maverick-security

« back to all changes in this revision

Viewing changes to exa/exa_render.c

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2010-08-05 11:25:14 UTC
  • mfrom: (1.1.35 upstream) (0.1.14 experimental)
  • Revision ID: james.westby@ubuntu.com-20100805112514-q4efdgj3nblevos2
Tags: 2:1.8.99.905-1ubuntu1
* Merge from (unreleased) Debian experimental.  Remaining Ubuntu changes:
  - rules, control:
    + Disable SELinux, libaudit-dev is not in main yet (LP 406226).
      Drop libaudit-dev from build-deps.
  - rules: Enable xcsecurity (LP 247537).
  - local/xvfb-run*: Add correct docs about error codes (LP 328205)
  - rules: Add --with-extra-module-dir to support GL alternatives.
  - control: Xvfb depends on xauth, x11-xkb-utils. (LP 500102)
  - rules, local/64-xorg-xkb.rules: Don't use keyboard-configuration
    until it's available.
  - control: Update some versioned Breaks for Ubuntu versions.
  - 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
    + 187_edid_quirk_hp_nc8430.patch:
      Quirk for another LPL monitor (LP 380009)
    + 188_default_primary_to_first_busid.patch:
      Pick the first device and carry on (LP 459512)
    + 189_xserver_1.5.0_bg_none_root.patch:
      Create a root window with no background.
    + 190_cache-xkbcomp_output_for_fast_start_up.patch:
      Cache keyboard settings.
    + 191-Xorg-add-an-extra-module-path.patch:
      Add support for the alternatives module path.
    + 197_xvfb-randr.patch:
      Adds xrandr support to xvfb. (LP 516123)
    + 198_nohwaccess.patch:
      Adds a -nohwaccess argument to make X not access the hardware
      ports directly.
    + 200_randr-null.patch:
      Clarify a pointer initialization.
* Update changelog entries for 1.8.1.902-1 which became 1.8.99.904-1
* Drop 196_xvfbscreeninit-handling.patch: it's semantically empty, and now 
  doesn't apply.  Merge remaining #include change into 197_xvfb-randr.patch
* New upstream version will start correctly when no outputs are connected,
  as long as the video driver can dynamically resize the framebuffer
  (true for all KMS drivers) (LP: #337889)
* New upstream version fixes crash on non-admin logout with KDE (LP: #569879)
* Refresh 111_armel-drv-fallbacks.patch to fix the build on armel

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
#include "exa_priv.h"
32
32
 
33
 
#ifdef RENDER
34
33
#include "mipict.h"
35
34
 
36
35
#if DEBUG_TRACE_FALL
293
292
 
294
293
    exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y);
295
294
 
296
 
    REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
 
295
    RegionTranslate(&region, dst_off_x, dst_off_y);
297
296
 
298
297
    if (pSrc->pDrawable) {
299
298
        pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
306
305
        !exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
307
306
                             pDst->pFormat))
308
307
    {
309
 
        REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 
308
        RegionUninit(&region);
310
309
        return -1;
311
310
    }
312
311
 
321
320
    }
322
321
 
323
322
    if (!exaPixmapHasGpuCopy(pDstPix)) {
324
 
        REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 
323
        RegionUninit(&region);
325
324
        return 0;
326
325
    }
327
326
 
328
327
    if (!(*pExaScr->info->PrepareSolid) (pDstPix, GXcopy, 0xffffffff, pixel))
329
328
    {
330
 
        REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 
329
        RegionUninit(&region);
331
330
        return -1;
332
331
    }
333
332
 
334
 
    nbox = REGION_NUM_RECTS(&region);
335
 
    pbox = REGION_RECTS(&region);
 
333
    nbox = RegionNumRects(&region);
 
334
    pbox = RegionRects(&region);
336
335
 
337
336
    while (nbox--)
338
337
    {
343
342
    (*pExaScr->info->DoneSolid) (pDstPix);
344
343
    exaMarkSync(pDst->pDrawable->pScreen);
345
344
 
346
 
    REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 
345
    RegionUninit(&region);
347
346
    return 1;
348
347
}
349
348
 
470
469
                                       rects->width, rects->height))
471
470
            goto next_rect;
472
471
 
473
 
        REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
 
472
        RegionTranslate(&region, dst_off_x, dst_off_y);
474
473
 
475
 
        nbox = REGION_NUM_RECTS(&region);
476
 
        pbox = REGION_RECTS(&region);
 
474
        nbox = RegionNumRects(&region);
 
475
        pbox = RegionRects(&region);
477
476
 
478
477
        xMask = xMask + mask_off_x - xDst - dst_off_x;
479
478
        yMask = yMask + mask_off_y - yDst - dst_off_y;
495
494
        }
496
495
 
497
496
    next_rect:
498
 
        REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 
497
        RegionUninit(&region);
499
498
 
500
499
        rects++;
501
500
    }
576
575
         * (see use of DamagePendingRegion in exaCopyDirty)
577
576
         */
578
577
 
579
 
        REGION_INIT(pScreen, &region, &box, 1);
 
578
        RegionInit(&region, &box, 1);
580
579
    
581
580
        DamageRegionAppend(pDst->pDrawable, &region);
582
581
 
583
 
        REGION_UNINIT(pScreen, &region);
 
582
        RegionUninit(&region);
584
583
    }
585
584
    
586
585
    /************************************************************/
704
703
 
705
704
    exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y);
706
705
 
707
 
    REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
 
706
    RegionTranslate(&region, dst_off_x, dst_off_y);
708
707
 
709
708
    if (pExaScr->do_migration) {
710
709
        ExaMigrationRec pixmaps[3];
738
737
    if (pSrcPix) {
739
738
        pSrcPix = exaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x, &src_off_y);
740
739
        if (!pSrcPix) {
741
 
            REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 
740
            RegionUninit(&region);
742
741
            return 0;
743
742
        }
744
743
    }
747
746
        pMaskPix = exaGetOffscreenPixmap (pMask->pDrawable, &mask_off_x,
748
747
                                          &mask_off_y);
749
748
        if (!pMaskPix) {
750
 
            REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 
749
            RegionUninit(&region);
751
750
            return 0;
752
751
        }
753
752
    }
754
753
 
755
754
    if (!exaPixmapHasGpuCopy(pDstPix)) {
756
 
        REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 
755
        RegionUninit(&region);
757
756
        return 0;
758
757
    }
759
758
 
760
759
    if (!(*pExaScr->info->PrepareComposite) (op, pSrc, pMask, pDst, pSrcPix,
761
760
                                             pMaskPix, pDstPix))
762
761
    {
763
 
        REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 
762
        RegionUninit(&region);
764
763
        return -1;
765
764
    }
766
765
 
767
 
    nbox = REGION_NUM_RECTS(&region);
768
 
    pbox = REGION_RECTS(&region);
 
766
    nbox = RegionNumRects(&region);
 
767
    pbox = RegionRects(&region);
769
768
 
770
769
    xMask = xMask + mask_off_x - xDst - dst_off_x;
771
770
    yMask = yMask + mask_off_y - yDst - dst_off_y;
789
788
    (*pExaScr->info->DoneComposite) (pDstPix);
790
789
    exaMarkSync(pDst->pDrawable->pScreen);
791
790
 
792
 
    REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 
791
    RegionUninit(&region);
793
792
    return 1;
794
793
}
795
794
 
954
953
                    goto done;
955
954
 
956
955
                ret = exaHWCopyNtoN(pSrc->pDrawable, pDst->pDrawable, NULL,
957
 
                             REGION_RECTS(&region), REGION_NUM_RECTS(&region),
 
956
                             RegionRects(&region), RegionNumRects(&region),
958
957
                             xSrc - xDst, ySrc - yDst, FALSE, FALSE);
959
 
                REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 
958
                RegionUninit(&region);
960
959
 
961
960
                /* Reset values to their original values. */
962
961
                xDst -= pDst->pDrawable->x;
1006
1005
                                         (PixmapPtr)pSrc->pDrawable,
1007
1006
                                         &patOrg, FB_ALLONES, GXcopy, CT_NONE);
1008
1007
 
1009
 
                REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 
1008
                RegionUninit(&region);
1010
1009
 
1011
1010
                if (ret)
1012
1011
                    goto done;
1072
1071
    if (pMask)
1073
1072
        pMask->repeat = saveMaskRepeat;
1074
1073
}
1075
 
#endif
1076
1074
 
1077
1075
/**
1078
1076
 * Same as miCreateAlphaPicture, except it uses ExaCheckPolyFillRect instead