From patchwork Sun Sep 7 21:30:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 4859421 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8BE74C0338 for ; Sun, 7 Sep 2014 21:31:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CD1182012F for ; Sun, 7 Sep 2014 21:31:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0284B2012D for ; Sun, 7 Sep 2014 21:31:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B2AAC6E0F3; Sun, 7 Sep 2014 14:31:39 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E0EE89DB8 for ; Sun, 7 Sep 2014 14:31:37 -0700 (PDT) Received: by mail-wg0-f52.google.com with SMTP id x13so1053129wgg.35 for ; Sun, 07 Sep 2014 14:31:37 -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=WQmBmk+1o/I4YSIGNQ4mLOE/7Nj2GsMDLP4wOW9BOL0=; b=l2yfovFShvm+L3Qd/MvSbCszVu+TF1Jidg0tdLAhghMhUu8dzMmCPv5Fa+/ZO8uxEv GeIuiwSyV58NPQ+RbC8gY2S0MMTeTomITMqvQjSQOPeOwpbv6lM0uuKEBUC/IBQwNhv0 sEy9rEZ7eipTsEI5rC5Nsv8mH/Nk4e7PyfRv8a68340NC+vDJCLkfu8HupOLR38Wq33J EjzOIhj5myUN0Pi9YAFbH393tJUxtl5o2dz1tooNuDlcdZwOafrPUtBirwu9q9SHTFVy 0Yc9kP22frlVG/FDc7yukQC5QVtd4wjEQAQ114OaZXsHWil/Afuu76QnnZ7cn/NUbL7N VC5A== X-Received: by 10.180.74.198 with SMTP id w6mr18295540wiv.7.1410125497437; Sun, 07 Sep 2014 14:31:37 -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.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Sep 2014 14:31:36 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 13/18] drm: use drm_mmap/drm_munmap wrappers Date: Sun, 7 Sep 2014 22:30:08 +0100 Message-Id: <1410125413-19465-14-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 Signed-off-by: Emil Velikov --- xf86drm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xf86drm.c b/xf86drm.c index 85beb8c..d900b4b 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -48,7 +48,6 @@ #include #define stat_t struct stat #include -#include #include #include @@ -58,6 +57,7 @@ #endif #include "xf86drm.h" +#include "libdrm.h" #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) #define DRM_MAJOR 145 @@ -1137,7 +1137,7 @@ int drmMap(int fd, drm_handle_t handle, drmSize size, drmAddressPtr address) size = (size + pagesize_mask) & ~pagesize_mask; - *address = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, handle); + *address = drm_mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, handle); if (*address == MAP_FAILED) return -errno; return 0; @@ -1157,7 +1157,7 @@ int drmMap(int fd, drm_handle_t handle, drmSize size, drmAddressPtr address) */ int drmUnmap(drmAddress address, drmSize size) { - return munmap(address, size); + return drm_munmap(address, size); } drmBufInfoPtr drmGetBufInfo(int fd) @@ -1264,7 +1264,7 @@ int drmUnmapBufs(drmBufMapPtr bufs) int i; for (i = 0; i < bufs->count; i++) { - munmap(bufs->list[i].address, bufs->list[i].total); + drm_munmap(bufs->list[i].address, bufs->list[i].total); } drmFree(bufs->list);