From patchwork Sun Sep 7 21:30:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 4859471 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 BAD539F666 for ; Sun, 7 Sep 2014 21:31:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A4FD92012F for ; Sun, 7 Sep 2014 21:31:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BC7CD2012D for ; Sun, 7 Sep 2014 21:31:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 139B26E20C; Sun, 7 Sep 2014 14:31:44 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by gabe.freedesktop.org (Postfix) with ESMTP id E7A4F6E19D for ; Sun, 7 Sep 2014 14:31:41 -0700 (PDT) Received: by mail-wi0-f179.google.com with SMTP id q5so1719375wiv.0 for ; Sun, 07 Sep 2014 14:31:41 -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=ngGkA0NVUidhrRzX4WmFymLrEmJIB/4k7uB5ll+fuoM=; b=U6w2GXYLIWOgZc5JxFvr/IW3MPZJAW4hgFkTvxnVlhTvd3w4LCpqZFUsKRHxIwjV37 m0fNnYl4T6I3Jud2fOZmTMjN0SSl14EOENTmbcnUJnOuIzBX4AY17+mpOLB95Zxjfe7A 3TRedQ8PIGS2fkKqC8yD2eu0UE0SEPetdJARssaxaSgW5YjmoT0WxwSa+jyMBgYgILuL aU5hV7vRDLq62vBIKQObchO45+0zWmjqgaCWGA1yVVGi1fSRZPq2OS3cp64SxG8dpzzJ Bi1coyNSonKbXCZ/la09DrJoh8SDz0OS3E7cxasETo8GZTfQ7Ri1MsU8V5QPQAxXxPid 6RZQ== X-Received: by 10.180.12.173 with SMTP id z13mr18278487wib.53.1410125500965; Sun, 07 Sep 2014 14:31:40 -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.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Sep 2014 14:31:40 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 16/18] radeon: use drm_mmap/drm_munmap wrappers Date: Sun, 7 Sep 2014 22:30:11 +0100 Message-Id: <1410125413-19465-17-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 --- radeon/radeon_bo_gem.c | 7 +++---- radeon/radeon_cs_gem.c | 1 - radeon/radeon_surface.c | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/radeon/radeon_bo_gem.c b/radeon/radeon_bo_gem.c index 251ec1b..e78303a 100644 --- a/radeon/radeon_bo_gem.c +++ b/radeon/radeon_bo_gem.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include "libdrm.h" #include "xf86drm.h" @@ -135,7 +134,7 @@ static struct radeon_bo *bo_unref(struct radeon_bo_int *boi) return (struct radeon_bo *)boi; } if (bo_gem->priv_ptr) { - munmap(bo_gem->priv_ptr, boi->size); + drm_munmap(bo_gem->priv_ptr, boi->size); } /* Zero out args to make valgrind happy */ @@ -179,7 +178,7 @@ static int bo_map(struct radeon_bo_int *boi, int write) boi, boi->handle, r); return r; } - ptr = mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED, boi->bom->fd, args.addr_ptr); + ptr = drm_mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED, boi->bom->fd, args.addr_ptr); if (ptr == MAP_FAILED) return -errno; bo_gem->priv_ptr = ptr; @@ -198,7 +197,7 @@ static int bo_unmap(struct radeon_bo_int *boi) if (--bo_gem->map_count > 0) { return 0; } - //munmap(bo->ptr, bo->size); + //drm_munmap(bo->ptr, bo->size); boi->ptr = NULL; return 0; } diff --git a/radeon/radeon_cs_gem.c b/radeon/radeon_cs_gem.c index 2020e1a..705ee05 100644 --- a/radeon/radeon_cs_gem.c +++ b/radeon/radeon_cs_gem.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include "radeon_cs.h" #include "radeon_cs_int.h" diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c index 40a544a..0723425 100644 --- a/radeon/radeon_surface.c +++ b/radeon/radeon_surface.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include "drm.h" #include "libdrm.h"