From patchwork Sun Sep 7 21:30:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 4859461 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C0FA79F371 for ; Sun, 7 Sep 2014 21:31:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CA3C420122 for ; Sun, 7 Sep 2014 21:31:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DDDAD20120 for ; Sun, 7 Sep 2014 21:31:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 268016E1F3; Sun, 7 Sep 2014 14:31:42 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f173.google.com (mail-we0-f173.google.com [74.125.82.173]) by gabe.freedesktop.org (Postfix) with ESMTP id 62D3C89DC9 for ; Sun, 7 Sep 2014 14:31:39 -0700 (PDT) Received: by mail-we0-f173.google.com with SMTP id u56so639101wes.32 for ; Sun, 07 Sep 2014 14:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SieN4/SpGJy/0yyxop6qhTbv4eJBIHSb7znFNpL055k=; b=Iedk4Hl566VEouMpmwzuvbN6nCrIVyst51EvRN2LCL5TdM08LYZtVpqNVqyuQUtzQh kDWqtAGnphmcaRPJLgdn3UKCoP4UoRrXYLbI1FtfwzjO+lLESjfuzGiEtfPzFtqNOpn1 S8YJXZaMpAwSu+wT/1K474ydyskpKiWd8kzTeGIU2VX0QMcAlMzRqJlx0d6BLysRu8fr bc0MYjgm7ORTOxKe4hopzhmkDsdnGz2anREPEJV9w5znXKT/2DDvXFeu3uQtuUUPLapp dsaNecsXEdwKCuhNDxoBxDxBFkFXHtL7FATAL3TpKeehOut+JK67O7KN4zcDLtfI8KEJ c+NA== X-Received: by 10.180.20.196 with SMTP id p4mr18031629wie.56.1410125498715; Sun, 07 Sep 2014 14:31:38 -0700 (PDT) Received: from localhost.localdomain (cpc20-stap10-2-0-cust563.12-2.cable.virginm.net. [82.20.130.52]) by mx.google.com with ESMTPSA id ub19sm9644662wib.9.2014.09.07.14.31.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Sep 2014 14:31:38 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 14/18] libkms: use drm_mmap/drm_munmap wrappers Date: Sun, 7 Sep 2014 22:30:09 +0100 Message-Id: <1410125413-19465-15-git-send-email-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1410125413-19465-1-git-send-email-emil.l.velikov@gmail.com> References: <1410125413-19465-1-git-send-email-emil.l.velikov@gmail.com> Cc: emil.l.velikov@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ... for all by exynos. Signed-off-by: Emil Velikov --- libkms/dumb.c | 8 +++----- libkms/intel.c | 6 +++--- libkms/nouveau.c | 6 +++--- libkms/radeon.c | 8 ++++---- libkms/vmwgfx.c | 6 +++--- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/libkms/dumb.c b/libkms/dumb.c index 5702543..f9c16e1 100644 --- a/libkms/dumb.c +++ b/libkms/dumb.c @@ -36,11 +36,9 @@ #include #include "internal.h" -#include #include #include "xf86drm.h" - -#include "i915_drm.h" +#include "libdrm.h" struct dumb_bo { @@ -149,7 +147,7 @@ dumb_bo_map(struct kms_bo *_bo, void **out) if (ret) return ret; - map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset); + map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset); if (map == MAP_FAILED) return -errno; @@ -177,7 +175,7 @@ dumb_bo_destroy(struct kms_bo *_bo) if (bo->base.ptr) { /* XXX Sanity check map_count */ - munmap(bo->base.ptr, bo->base.size); + drm_munmap(bo->base.ptr, bo->base.size); bo->base.ptr = NULL; } diff --git a/libkms/intel.c b/libkms/intel.c index b006ea4..51a7fd2 100644 --- a/libkms/intel.c +++ b/libkms/intel.c @@ -36,9 +36,9 @@ #include #include "internal.h" -#include #include #include "xf86drm.h" +#include "libdrm.h" #include "i915_drm.h" @@ -173,7 +173,7 @@ intel_bo_map(struct kms_bo *_bo, void **out) if (ret) return ret; - map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset); + map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset); if (map == MAP_FAILED) return -errno; @@ -201,7 +201,7 @@ intel_bo_destroy(struct kms_bo *_bo) if (bo->base.ptr) { /* XXX Sanity check map_count */ - munmap(bo->base.ptr, bo->base.size); + drm_munmap(bo->base.ptr, bo->base.size); bo->base.ptr = NULL; } diff --git a/libkms/nouveau.c b/libkms/nouveau.c index 15c012e..228903f 100644 --- a/libkms/nouveau.c +++ b/libkms/nouveau.c @@ -36,9 +36,9 @@ #include #include "internal.h" -#include #include #include "xf86drm.h" +#include "libdrm.h" #include "nouveau_drm.h" @@ -155,7 +155,7 @@ nouveau_bo_map(struct kms_bo *_bo, void **out) return 0; } - map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle); + map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle); if (map == MAP_FAILED) return -errno; @@ -183,7 +183,7 @@ nouveau_bo_destroy(struct kms_bo *_bo) if (bo->base.ptr) { /* XXX Sanity check map_count */ - munmap(bo->base.ptr, bo->base.size); + drm_munmap(bo->base.ptr, bo->base.size); bo->base.ptr = NULL; } diff --git a/libkms/radeon.c b/libkms/radeon.c index 938321b..9383a0a 100644 --- a/libkms/radeon.c +++ b/libkms/radeon.c @@ -36,9 +36,9 @@ #include #include "internal.h" -#include #include #include "xf86drm.h" +#include "libdrm.h" #include "radeon_drm.h" @@ -172,7 +172,7 @@ radeon_bo_map(struct kms_bo *_bo, void **out) if (ret) return -errno; - map = mmap(0, arg.size, PROT_READ | PROT_WRITE, MAP_SHARED, + map = drm_mmap(0, arg.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.addr_ptr); if (map == MAP_FAILED) return -errno; @@ -189,7 +189,7 @@ radeon_bo_unmap(struct kms_bo *_bo) { struct radeon_bo *bo = (struct radeon_bo *)_bo; if (--bo->map_count == 0) { - munmap(bo->base.ptr, bo->base.size); + drm_munmap(bo->base.ptr, bo->base.size); bo->base.ptr = NULL; } return 0; @@ -204,7 +204,7 @@ radeon_bo_destroy(struct kms_bo *_bo) if (bo->base.ptr) { /* XXX Sanity check map_count */ - munmap(bo->base.ptr, bo->base.size); + drm_munmap(bo->base.ptr, bo->base.size); bo->base.ptr = NULL; } diff --git a/libkms/vmwgfx.c b/libkms/vmwgfx.c index 08163a1..bc04133 100644 --- a/libkms/vmwgfx.c +++ b/libkms/vmwgfx.c @@ -35,8 +35,8 @@ #include #include "internal.h" -#include #include "xf86drm.h" +#include "libdrm.h" #include "vmwgfx_drm.h" struct vmwgfx_bo @@ -146,7 +146,7 @@ vmwgfx_bo_map(struct kms_bo *_bo, void **out) return 0; } - map = mmap(NULL, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle); + map = drm_mmap(NULL, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle); if (map == MAP_FAILED) return -errno; @@ -173,7 +173,7 @@ vmwgfx_bo_destroy(struct kms_bo *_bo) if (bo->base.ptr) { /* XXX Sanity check map_count */ - munmap(bo->base.ptr, bo->base.size); + drm_munmap(bo->base.ptr, bo->base.size); bo->base.ptr = NULL; }