Commits on Dec 1, 2015
  1. @android-x86 @evelikov

    intel: add the missing <strings.h> include

    It defines the prototype of ffs that fixes the building error
    on Android 6.0 64-bit image.
    
    Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
    android-x86 committed with evelikov Oct 30, 2015
Commits on Nov 21, 2015
  1. amdgpu: Make amdgpu_cs_calculate_timeout() return something sensible …

    …on error
    
    Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Tom St Denis committed with Alex Deucher Nov 17, 2015
  2. amdgpu: fix overflow for timeout calculation

    Set the timeout to AMDGPU_TIMEOUT_INFINITE when overflow happens
    
    Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Jammy Zhou committed with Alex Deucher Nov 17, 2015
Commits on Nov 16, 2015
  1. @evelikov

    configure.ac: test for the same atomic function as the one we use

    Unlikely that we'll hit a case where __sync_fetch_and_add is present
    while __sync_add_and_fetch isn't. Regardless let's keep things sane and
    consistent.
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    evelikov committed Nov 16, 2015
  2. @jonathangray @evelikov

    configure.ac: rework compiler builtin atomic tests

    The libdrm autoconf test for atomics uses __sync_val_compare_and_swap with
    the address of a function argument which triggers a gcc ICE on sparc64
    with the OpenBSD system compiler.
    
    Mark Kettenis pointed out that while other architectures probably spill the
    argument onto the stack this is likely not the case on register window
    architectures like SPARC and suggested passing a pointer as an argument
    instead which avoids the ICE and allows the drm libraries requiring
    atomics to build on sparc64 with the autoconf build.
    
    Reported-by: Christian Weisgerber <naddy@openbsd.org>
    Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
    Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
    Reviewed-by: Matthieu Herrb <matthieu@openbsd.org>
    jonathangray committed with evelikov Aug 29, 2015
Commits on Nov 10, 2015
  1. radeon: Handle surface offsets exceeding 32 bits correctly

    The slice_size and bo_size fields were getting truncated to 32 bits.
    
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Michel Dänzer committed with Michel Dänzer Sep 8, 2015
Commits on Nov 5, 2015
  1. @freedreno

    libdrm: Use userspace compatible type in fourcc_mod_code macro

    __u64 should be used instead of u64.
    
    Kernel headers originally pulled in:
    
    commit 8983fe5
    Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
    Date:   Mon Aug 3 10:48:03 2015 +0100
    
        libdrm: Add framebuffer modifiers uapi
    
    Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
    Cc: dri-devel@lists.freedesktop.org
    Cc: Rob Clark <robdclark@gmail.com>
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Rob Clark <robclark@freedesktop.org>
    Tvrtko Ursulin committed with freedreno Sep 23, 2015
Commits on Nov 3, 2015
  1. @bwidawsk

    intel: Cleanup SKL PCI ID definitions.

    This removes ones which aren't used, and adds some new ones. I kept the original
    names where possible.
    
    Cc: Kristian Høgsberg <krh@bitplanet.net>
    Cc: Damien Lespiau <damien.lespiau@intel.com>
    Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
    Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
    bwidawsk committed Oct 22, 2015
  2. @bwidawsk

    intel: Add SKL GT4 PCI IDs

    Cc: Kristian Høgsberg <krh@bitplanet.net>
    Cc: Damien Lespiau <damien.lespiau@intel.com>
    Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
    Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
    bwidawsk committed Oct 22, 2015
Commits on Oct 22, 2015
  1. amdgpu: Cleanly handle ENOMEM on result in amdgpu_bo_list_create()

    Move the allocation of result prior to the IOCTL so we can cleanly
    backtrack if the allocation fails.
    
    Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Tom St Denis committed with Alex Deucher Oct 9, 2015
  2. amdgpu: Fix use-after-free bug in vamgr_deinit

    This patch fixes a use-after-free bug in the vamgr_deinit function.
    
    Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Tom St Denis committed with Alex Deucher Oct 9, 2015
  3. amdgpu: Unlock mutex if base_required is invalid

    In the function amdgpu_vamgr_find_va() the function would return
    without unlocking the mutex if the base_required offset was below
    the va managers base offset.
    
    Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Tom St Denis committed with Alex Deucher Oct 9, 2015
Commits on Oct 20, 2015
  1. drm: add virtgpu_drm.h

    This is in drm-next now, so add to libdrm.
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Dave Airlie committed Oct 21, 2015
  2. @mattrope @evelikov

    xf86drm: Handle unrecognized subsystems safely in drmGetDevice[s]()

    Both drmGetDevice() and drmGetDevices() currently print a warning when
    they encounter an unknown (non-PCI) subsystem type for a device node,
    but they still proceed to assume that the drmDevicePtr was initialized
    and try to add it to the local device array.  Add a 'continue' to the
    error case handling to bypass the rest of the processing for devices we
    can't handle.
    
    Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
    mattrope committed with evelikov Oct 16, 2015
  3. @mattrope @evelikov

    xf86drm: Fix error handling for drmGetDevice()

    Some of the error conditions in drmGetDevice() can lead to us calling
    closedir(NULL) or leaking memory.  Fix these conditions the same way we
    did for drmGetDevices() in commit:
    
            commit 8c4a1cb
            Author: Matt Roper <matthew.d.roper@intel.com>
            Date:   Wed Sep 30 09:30:51 2015 -0700
    
                xf86drm: Fix error handling for drmGetDevices()
    
    Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
    mattrope committed with evelikov Oct 16, 2015
Commits on Oct 14, 2015
  1. Fix void pointer arithmetic in drmProcessPciDevice

    Arithmetic on void pointers is a GCC extension.
    
      CC       libdrm_la-xf86drm.lo
    ../xf86drm.c: In function 'drmProcessPciDevice':
    ../xf86drm.c:3017:10: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
         addr += sizeof(drmDevice);
              ^
    ../xf86drm.c:3020:10: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
         addr += DRM_NODE_MAX * sizeof(void *);
              ^
    ../xf86drm.c:3023:14: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
             addr += max_node_str;
                  ^
    ../xf86drm.c:3035:14: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
             addr += sizeof(drmPciBusInfo);
                  ^
    
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Michel Dänzer committed with Michel Dänzer Oct 14, 2015
Commits on Oct 2, 2015
  1. @mattrope @evelikov

    xf86drm: Fix error handling for drmGetDevices()

    If the opendir() call in drmGetDevices() returns failure, we jump to an
    error label that calls closedir() and then returns.  However this means
    that we're calling closedir(NULL) which may not be safe on all
    implementations.  We are also leaking the local_devices array that was
    allocated before the opendir() call.
    
    Fix both of these issues by jumping to an earlier error label (to free
    local_devices) and guarding the closedir() call with a NULL test.
    
    Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
    [Emil Velikov: make the teardown symmetrical, remove the NULL check]
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    mattrope committed with evelikov Sep 30, 2015
Commits on Sep 28, 2015
  1. @doughdemon @evelikov

    xf86drm: include <limits.h> for PATH_MAX

    fixes compilation error with musl libc and Solaris based platforms.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92082
    Signed-off-by: Felix Janda <felix.janda@posteo.de>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
    doughdemon committed with evelikov Sep 26, 2015
Commits on Sep 21, 2015
  1. @evelikov

    xf86drm: remove makedev() hack/workaround

    Back when this was introduced commit 569da5a(Merged glxmisc-3-0-0)
    sys/sysmacros.h was used instead of the respecive headers (as per the
    manual).
    
    We've been handling it correctly for a little while now - in Linux, BSD
    and Solaris. Thus we can drop this workaround.
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    evelikov committed Aug 7, 2015
  2. @tobiasjakobi @evelikov

    exynos/fimg2d: remove g2d_context from public header

    All functions from the public API only operation on
    struct g2d_context*, so this shouldn't break too much.
    
    Make the context private since we don't want the
    user to modify its content directly. Also remove
    the defines that were only used for fields of
    g2d_context.
    
    Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
    tobiasjakobi committed with evelikov Sep 8, 2015
  3. @tobiasjakobi @evelikov

    exynos/fimg2d: add message prefix

    Add a prefix to the messages printed to the console via
    printf() and fprintf() so that one can easily see where
    the message comes from.
    
    Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
    tobiasjakobi committed with evelikov Sep 8, 2015
  4. @tobiasjakobi @evelikov

    exynos/fimg2d: make g2d_add_cmd() less heavy

    The function currently checks for each added command
    if an overflow of the corresponding command buffers
    occurs, but none of the callers ever checks the
    return value.
    
    Since all callers are now converted to use
    g2d_check_space() simplify the function.
    
    (1) The overflow checks become asserts, so they're only
        active for debug builds. This is fine since
        g2d_add_cmd() is not part of the public API.
    
    (2) Switch the return value to void.
    
    (3) Explicitly state that the caller has to check
        buffer space before calling g2d_add_cmd().
    
    Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
    tobiasjakobi committed with evelikov Sep 8, 2015
  5. @tobiasjakobi @evelikov

    exynos/fimg2d: remove superfluous initialization of g2d_point_val

    The g2d_point_val union consists of two coordinates of 16
    bits. Whenever this union is used though, both coordinates
    are explicitly set. Hence prior initialization is unnecessary.
    
    Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
    tobiasjakobi committed with evelikov Sep 8, 2015
  6. @tobiasjakobi @evelikov

    exynos/fimg2d: remove default case from g2d_get_blend_op()

    We now validate the blending mode via g2d_validate_mode()
    prior to feeding it to g2d_get_blend_op().
    
    Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
    tobiasjakobi committed with evelikov Sep 8, 2015
  7. @tobiasjakobi @evelikov

    exynos/fimg2d: add g2d_validate_xyz() functions

    The G2D headers define a number of modes through enums
    (like e.g. color, select, repeat, etc.).
    
    This introduces g2d_validate_select_mode() and
    g2d_validate_blending_op() which validate a
    select mode or blending operation respectively.
    
    Use this together with g2d_check_space() in
    g2d_{blend,scale_and_blend}().
    
    For this we move parameter validation to the top and
    also validate the select mode of the source image and
    the requested blending operation before starting
    command submission.
    
    Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
    tobiasjakobi committed with evelikov Sep 8, 2015
  8. @tobiasjakobi @evelikov

    exynos/fimg2d: add g2d_check_space()

    This is going to be used to check if the command buffers have
    enough space left prior to actual submission of the commands.
    
    Use this in g2d_{solid_fill,copy,copy_with_scale}().
    
    For this the parameter validation before buffer space
    checking so that we can exit early if it fails.
    Also don't reset the G2D context in this situation since
    the buffers are not partially submitted anymore.
    
    The repeat mode in g2d_copy_with_scale() is checked first
    to make computation of space easier.
    
    Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
    tobiasjakobi committed with evelikov Sep 8, 2015
  9. @tobiasjakobi @evelikov

    exynos/fimg2d: simplify base address submission in g2d_scale_and_blend()

    Use g2d_add_base_addr() for source and destination base
    address just like all other calls.
    
    Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
    tobiasjakobi committed with evelikov Sep 8, 2015
  10. @tobiasjakobi @evelikov

    exynos/fimg2d: fix empty buffer handling in g2d_flush()

    Empty command buffers are no error, we just don't have
    anything to do for flushing then.
    
    Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
    Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
    tobiasjakobi committed with evelikov Sep 8, 2015
  11. @evelikov

    Fix SunOS/NetBSD atomic macro

    Reported-by: Evgeny Litvinenko <evgeny.v.litvinenko@gmail.com>
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    evelikov committed Sep 21, 2015
  12. @evelikov

    tests/drmdevice: add drm{Get,Free}Device() example

    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    Acked-by: Alex Deucher <alexander.deucher@amd.com>
    evelikov committed Sep 9, 2015
  13. @evelikov

    xf86drm: add drm{Get,Free}Device

    Similar interface to the *Devices() ones but they obtain/free the
    information of the opened device (as given by its fd).
    
    Note there is a fair bit of duplication between the two Get functions,
    and anyone interested is more than welcome to consolidate it.
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    Acked-by: Alex Deucher <alexander.deucher@amd.com>
    evelikov committed Sep 9, 2015
  14. @evelikov

    xf86drm: split out drmProcessPciDevice and drmFoldDuplicatedDevices

    Will be reused in the next commit.
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    Acked-by: Alex Deucher <alexander.deucher@amd.com>
    evelikov committed Sep 9, 2015
  15. @evelikov

    xf86drm: warn on missing drmGetMinorNameForFD implementation

    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    Acked-by: Alex Deucher <alexander.deucher@amd.com>
    evelikov committed Sep 7, 2015
  16. @evelikov

    xf86drm: move ifdef __linux__ guards where needed

    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    Acked-by: Alex Deucher <alexander.deucher@amd.com>
    evelikov committed Sep 7, 2015
  17. @evelikov

    xf86drm: rework drmGetDevices()

    Do a once off memory allocation for each drmDevice.
    
    This allows us to ease the error handling and simplify the
    de-duplication loop. As part of this we need to rework drmFreeDevice()
    such so that it frees the relevant hunks, rather than leaving that to
    the caller.
    
    Some memory stats from the drmdevice test
    
    before: 22 allocs, 22 frees, 66,922 bytes allocated
    after:   9 allocs, 9 frees, 66,436 bytes allocated
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    Acked-by: Alex Deucher <alexander.deucher@amd.com>
    evelikov committed Sep 7, 2015