Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various RENDER backports #440

Open
wants to merge 44 commits into
base: 3.6.x
Choose a base branch
from

Conversation

sunweaver
Copy link
Member

No description provided.

Keith Packard and others added 30 commits April 19, 2017 15:13
 And... Remove override for miPaintWindow from hw/nxagent/NXmiexpose.c,
 use the version that we ship in Xserver/mi/miexpose.c.

 commit 06d27f8045966c1fb154eafaff308a01b93f265b
 Author: Keith Packard <[email protected]>
 Date:   Wed Sep 12 23:57:30 2007 +0100

    Try again to fix drawable and tile offsets in miPaintWindow

    Many coordinate spaces are hard. Let's go drinking.

 commit dd3992eb86377684a5dbe86fa19c756a9e53cda2
 Author: Keith Packard <[email protected]>
 Date:   Wed Sep 12 22:39:31 2007 +0100

    miPaintWindow draw to window for background.

    Instead of drawing to window pixmap for everything, draw to window for
    background as that works for Xnest and Xdmx; draw to pixmap for borders
    which neither of those X servers use.

 commit 257c8ed17f4f908e0d0d5e53aaf13aa3b1313f50
 Author: Keith Packard <[email protected]>
 Date:   Wed Sep 12 12:11:49 2007 +0100

    Rewrite miPaintWindow to draw to window pixmap.

    miPaintWindow was drawing to the root window, or (sometimes) drawing to the
    window after smashing the window clip list. This is losing, and easily fixed
    by just drawing to the window pixmap.

 Backported-to-NX-by: Mike Gabriel <[email protected]>
 commit 1e56b2dfc6377234ffdcdf206528d476b04d13af
 Author: Adam Jackson <[email protected]>
 Date:   Fri Sep 12 12:51:13 2014 -0400

    mi: Move pScreen->SendGraphicsExpose up to dix

    No DDX is overriding this and it's fairly absurd to expose it as a
    screen operation anyway.

    Reviewed-by: Julien Cristau <[email protected]>
    Signed-off-by: Adam Jackson <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
…tRelative windows.

 commit 244a635fcdc9e0a7212d51b26d74f49d8e1b071f
 Author: Fredrik Höglund <[email protected]>
 Date:   Mon Aug 18 19:27:34 2008 +0200

    Fix the tile offset in miPaintWindow for ParentRelative windows.

 Backported-to-NX-by: Mike Gabriel <[email protected]>
…ntRelative

 commit b4061cf5f76241157b2dc81dec053012075311c0
 Author: Peter Harris <[email protected]>
 Date:   Tue May 12 14:19:15 2015 -0400

    Fix border tile origin when background is ParentRelative

    According to
    http://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html#requests:CreateWindow
    "The border tile origin is always the same as the background tile
    origin."

    ChangeWindowAttributes goes to some effort to make sure it repaints
    the border tile whenever the background origin may have changed, but
    ChangeWindowAttributes goes to some effort to make sure it repaints
    the border tile whenever the background origin may have changed, but
    miPaintWindow was ignoring the background origin.

    Found by xts XChangeWindowAttributes-3

    Signed-off-by: Peter Harris <[email protected]>
    Reviewed-by: Keith Packard <[email protected]>
    Signed-off-by: Keith Packard <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
…f32449724eeb9b95d93.

Move some fb code to mi code. Allows for easier changes afterwards, because the
diffs reference the new actual files.
…. Never used by nxagent (only consumer: XAA).

 Picked from the below X.org commit:

 commit 6ed08949af4f7ac09170d3d9581e4092b24a84ee
 Author: Eric Anholt <[email protected]>
 Date:   Tue Mar 27 17:31:28 2007 -0700

    Move libcw setup to the only renderer requiring it (XAA).

    Additionally, protect libcw setup behind checks for Render, to avoid
    segfaulting if Render isn't available (xnest).

    The previous setup was an ABI-preserving dance, which is better nuked now.
    Now, anything that needs libcw must explicitly initialize it, and
    miDisableCompositeWrapper (previously only called by EXA and presumably binary
    drivers) is gone.
 This change lets nxagent segfault in fb/fbsolid.c if the Composite
 extension gets enabled (nxagent +extension Composite :<disp>).

 However, as Composite support is broken anyway, currently, let's
 approach Composite support without the deprecated CompositeWrapper.

 Backported from X.org:

 commit a44a379a2a4c198dbd6ffd6cc0db376f8fb64327
 Author: Adam Jackson <[email protected]>
 Date:   Thu Jul 19 15:00:03 2012 -0400

    cw: Remove

    XAA was the only consumer.

    Signed-off-by: Adam Jackson <[email protected]>
    Reviewed-by: Dave Airlie <[email protected]>
    Reviewed-by: Alan Coopersmith <[email protected]>
    Reviewed-by: Alex Deucher <[email protected]>
    Reviewed-by: Daniel Stone <[email protected]>
    Acked-by: Aaron Plattner <[email protected]>
    Signed-off-by: Keith Packard <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
  pkg-config --libs zlib in Debian jessie returns buggy linker parameters. It
  includes the system's default multi-arch path for shared libs.

  When linking nxagent, having the system's default shared library path
  explicitly listed as a "-L" linker option confuses linking against the
  libXcomp*.so files in the build path.

  When linking nxagent, we don't want to link against the system's
  libXcomp*.so files, we want it to get linked explicitly against
  the just built libXcomp*.so files in nxcomp/ and nxcompshad/.

  This change assumes that -lzlib is always available in the system's
  default shared library path.
… components get mentioned first in the nxagent linker command.
…11/exports/lib when linking nxagent. As -L../../exports/lib is already present and points to the same location.
…f7ed072007b1d0b4de5ff1e5eababa418c794 again.

Fixes the position of ConnectionInfo lines within the files and removes
unnecessary declarations.
…file,xsha1.h},os/{Imakefile,xsha1.c}}}: backport SHA1 implementation.

We currently use libgcrypt as the implementation-provider, because it's the
most widely available and smallest library.
Since upstream switched to using XID's as PictFormat's data type, we need to
overwrite the data type to XID as used by Xlib. More information is provided in
the source code as a comment.
 commit ac15d4cecca377c5c31ab852c39bbd554ca48fe2
 Author: Tobias Stoeckmann <[email protected]>
 Date:   Mon Mar 13 19:13:14 2017 +0100

    render: Fix out of boundary heap access

    ProcRenderCreateRadialGradient and ProcRenderCreateConicalGradient must
    be protected against an integer overflow during length check. This is
    already included in ProcRenderCreateLinearGradient since the fix for
    CVE-2008-2362.

    This can only be successfully exploited on a 32 bit system for an
    out of boundary read later on. Validated by using ASAN.

    Reviewed-by: Adam Jackson <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
 commit 211d4c2d353b5e379716484055a3f58235ea65f4
 Author: Chris Wilson <[email protected]>
 Date:   Wed Dec 14 15:55:22 2011 +0000

    render: Propagate allocation failure from createSourcePicture()

    All the callers were already checking for failure, except that
    createSourcePicture() itself was failing to check whether it
    successfully allocated the Picture.

    [ajax: Rebase, fix line wrap of preceding line]

    Signed-off-by: Chris Wilson <[email protected]>
    Reviewed-by: Jeremy Huddleston <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
…icture()

 Ports X.org Xserver commit 211d4c2 to NXpicture.c.
 commit c7f84c880bbbb508016ad80390a11961b1c4214d
 Author: Chris Wilson <[email protected]>
 Date:   Mon Jan 27 09:44:48 2014 +0000

    render: Fix leak of filter params

    ==11097== 2,048 (+1,640) bytes in 32 (+26) blocks are definitely lost in loss record 1,570 of 1,719
    ==11097==    at 0x4C2A2DB: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==11097==    by 0x225EF3: SetPicturePictFilter (filter.c:339)
    ==11097==    by 0x22DF4F: ProcRenderSetPictureFilter (render.c:1773)
    ==11097==    by 0x15D25D: Dispatch (dispatch.c:432)
    ==11097==    by 0x14C7B9: main (main.c:298)

    [ajax: Fixed whitespace]

    Reviewed-by: Adam Jackson <[email protected]>
    Signed-off-by: Chris Wilson <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
 Ports X.org Xserver commit c7f84c8 to NXpicture.c.
 commit 7ed0c3912e1cbab960df308b9d4ea618be757fd2
 Author: Andrea Canciani <[email protected]>
 Date:   Wed Jul 27 10:52:31 2011 +0200

    render: Allow single-stop gradients

    The Render specification allows single-stop gradients and pixman 0.22
    (X server requires >= 0.27.2 now) can rasterize them correctly.

    [ajax: update commit message]

    Signed-off-by: Andrea Canciani <[email protected]>
    Reviewed-by: Soren Sandmann <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
 commit 67dd34fa734085ed67ba7790820fe4743d48b60f
 Author: Adam Jackson <[email protected]>
 Date:   Wed Jun 10 13:20:59 2015 -0400

    render: Simplify SProcRenderScale

    Since ProcRenderScale throws BadImplementation anyway it's pointless to
    waste time carefully swapping the request.

    Signed-off-by: Adam Jackson <[email protected]>
    Reviewed-by: Alan Coopersmith <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
 commit 4217db89ecd480fda2ee74fecba06c6713c2a0f0
 Author: Julien Cristau <[email protected]>
 Date:   Mon Mar 7 23:20:33 2016 +0100

    render: free already allocated formats in PictureInit failure case

    Probably pointless, if this fails you're not likely to get far...

    Reviewed-by: Rémi Cardona <[email protected]>
    Signed-off-by: Julien Cristau <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
…170)

 commit 802932d112a3f6a09420be9e4a13fa78ac43840b
 Author: Adam Jackson <[email protected]>
 Date:   Mon Nov 17 15:28:58 2014 -0500

    render: fix ChangePicture when Xinerama is active (v2) (#49170)

    ChangePicture takes wire XIDs, but didn't do any Xinerama translation,
    which meant setting a clip pixmap or a separate alpha picture would
    result in those elements pointing at the instance of the pixmap on
    screen 0.  Which is, you know, bad.

    v2: This one actually builds.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49170
    Signed-off-by: Adam Jackson <[email protected]>
    Reviewed-by: Keith Packard <[email protected]>
    Signed-off-by: Keith Packard <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
… substituted by Xserver/hw/nxagent/NXglyph.c.
nwnk and others added 14 commits April 19, 2017 16:53
 commit ba2432a020a9f9bd0892f643117795336ba0fc16
 Author: Adam Jackson <[email protected]>
 Date:   Thu Apr 10 11:34:28 2014 -0400

    xfixes: Forbid manipulating clip for source-only pictures (#28968)

    Just throw BadPicture instead of crashing.  It's not currently a
    meaningful thing to do anyway, RenderSetPictureRectangles would error if
    you tried (which this patch changes to BadPicture as well for
    consistency).  The problem with trying to do it is if the clip is
    specified as a pixmap then we try to convert it to a region, and
    ->BitmapToRegion requires a ScreenPtr, and source-only pictures don't
    have one.

    I can imagine a use for client clip on source-only pictures, so if we
    really wanted to allow this, probably the way forward is to always store
    the clip as a region internally, and when setting the clip _from_ a
    pixmap, look up BitmapToRegion relative to the pixmap not the picture.
    But since clearly nobody can be relying on it working...

    Signed-off-by: Adam Jackson <[email protected]>
    Reviewed-by: Hans de Goede <[email protected]>
    Reviewed-by: Keith Packard <[email protected]>
    Signed-off-by: Keith Packard <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
…cleanup

 Backporting note: Use calloc() calls instead of malloc() right-away when
 porting xalloc() functions.

 commit 4d575b0559817258f7a0ce6c4d2d0f9e7e5bba63
 Author: Robert Morell <[email protected]>
 Date:   Fri Jan 29 19:07:03 2010 -0800

    RENDER: Fix gradient and solid fill pictures with Xinerama, and misc cleanup

    If these aren't wrapped, then procs that are wrapped (such as
    RenderChangePicture) will fail in Xinerama when they see the resource
    type of a picture created through one of these interfaces is PictureType
    and not XRT_PICTURE like those allocated via RenderCreatePicture.

    Signed-off-by: Robert Morell <[email protected]>
    Reviewed-by: Aaron Plattner <[email protected]>
    Signed-off-by: Keith Packard <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
 commit 8460425740c72e58bcb897557f033e2836251160
 Author: Peter Hutterer <[email protected]>
 Date:   Wed Dec 10 12:31:59 2008 +0000

    render: rename SetBit to RenderSetBit.

    Avoiding namespace collision with the SetBit macro soon to be used in the
    input code.

    Signed-off-by: Peter Hutterer <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
 commit 8b75d0f9d347d7c3aad1e53809e0a2bed03b92fc
 Author: Peter Hutterer <[email protected]>
 Date:   Thu Sep 17 14:17:54 2009 +1000

    render: reply with the server or client version, whichever is lower.

    Protocol requires that the lower of [server version, client version] is
    returned to the client.

    The other part of the issue discussed in reply to [1] remains.
    [1] http://lists.freedesktop.org/archives/xorg-devel/2009-September/001990.html

    Reported-by: Julien Cristau

    Signed-off-by: Peter Hutterer <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
…r the client version, whichever is lower.

 Ports X.org Xserver commit 8b75d0f to NXrender.c (and has adaptations
 for nxagent).
 commit 42c2e14b254f6f882b3e79444360ab855db43e27
 Author: Matthieu Herrb <[email protected]>
 Date:   Fri Jun 15 00:14:02 2007 +0200

    swap xOrigin and yOrigin in SProcRenderSetPictureClipRectangles.

    Fixes Xrender clipping rectangles when X server and client are of
    different endianness, shown by xterm 225 among others.

 Backported-to-NX-by: Mike Gabriel <[email protected]>
 commit 6ef457913955d4289081c7d07d528963ccf5272c
 Author: Eric Anholt <[email protected]>
 Date:   Fri Jun 30 03:01:14 2006 +0200

    Bug #7366: Fix two crashes in operations on source pictures.

    A screen's ChangePictureTransform now isn't called when changing the transform,
    as source pictures aren't associated with screens.  Also, attempting to set
    an AlphaMap to a source picture will fail with BadMatch just like a Window
    would, preventing another crash.

 Backported-to-NX-by: Mike Gabriel <[email protected]>
 commit b6b88d2f62d8c596171f487dd25fbdbc85d0c5a8
 Author: Eric Anholt <[email protected]>
 Date:   Wed Jan 4 00:05:16 2006 +0000

    Correct rounding in divide-by-255 code. Obtained from xserver.

 Backported-to-NX-by: Mike Gabriel <[email protected]>
 commit dd0e8491f75afbd72bea17172a042aa45ff7e30b
 Author: Adam Jackson <[email protected]>
 Date:   Fri Jun 20 12:36:10 2014 -0400

    render: Remove unused CopyPicture

    Arguably this would be useful API, but it's never called, and a careful
    reading of the CPClipMask path reveals that callers would be fairly
    disappointed.

    Reviewed-by: Keith Packard <[email protected]>
    Signed-off-by: Adam Jackson <[email protected]>

 Backported-to-NX-by: Mike Gabriel <[email protected]>
@Ionic
Copy link
Member

Ionic commented May 10, 2017

Won't look at this right now, since it depends upon other PRs and is outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants