From patchwork Sun Sep 7 21:30:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 4859491 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 26E089F371 for ; Sun, 7 Sep 2014 21:31:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7908520131 for ; Sun, 7 Sep 2014 21:31:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D749520127 for ; Sun, 7 Sep 2014 21:31:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF5BE6E184; Sun, 7 Sep 2014 14:31:41 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by gabe.freedesktop.org (Postfix) with ESMTP id 8A0ED6E20C for ; Sun, 7 Sep 2014 14:31:40 -0700 (PDT) Received: by mail-wg0-f50.google.com with SMTP id x13so2343305wgg.33 for ; Sun, 07 Sep 2014 14:31:39 -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=qjKFSYwb7o37Ng5d+mu/FuW0HdrCYueF/I/0NgthBKs=; b=0otGi5siVzUVVQw/7wR9bZicswE/jzUW/vHPU6f7LBTeqXU4+uV1vIi5abjW3yn7AF 7tOIw8NAMjFdawx4YHs1Bu3b89Arm9nS24s9hmv7+lpcG+vVFwegfIY+zYMPcJItbqc3 OJwkUXo14jpVjQN/0gHJEBsN0UMzY7P8TcQWqTf9Wiy7xHJrzbE+9h7E41XQ6jSgVGG4 5xVJqcWE87/reb2bSYqGqV7Liqnw5wtZ9A0iBCQll2CUMsTK+rfRehTeUbALV3KTujYm ijUAhWuKcmDhh1YlceciQYD94/7paxzQA7o70ooDMLDPbUY8tu+xszcEB4Hju+W+8k96 tmzw== X-Received: by 10.180.77.193 with SMTP id u1mr18270061wiw.45.1410125499872; Sun, 07 Sep 2014 14:31:39 -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.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Sep 2014 14:31:39 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 15/18] nouveau: use drm_mmap/drm_munmap wrappers Date: Sun, 7 Sep 2014 22:30:10 +0100 Message-Id: <1410125413-19465-16-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 --- nouveau/nouveau.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c index 43f0d3c..da49e17 100644 --- a/nouveau/nouveau.c +++ b/nouveau/nouveau.c @@ -33,11 +33,11 @@ #include #include #include -#include #include #include #include +#include "libdrm.h" #include "libdrm_lists.h" #include "nouveau_drm.h" @@ -381,7 +381,7 @@ nouveau_bo_del(struct nouveau_bo *bo) drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req); } if (bo->map) - munmap(bo->map, bo->size); + drm_munmap(bo->map, bo->size); free(nvbo); } @@ -607,7 +607,7 @@ nouveau_bo_map(struct nouveau_bo *bo, uint32_t access, { struct nouveau_bo_priv *nvbo = nouveau_bo(bo); if (bo->map == NULL) { - bo->map = mmap(0, bo->size, PROT_READ | PROT_WRITE, + bo->map = drm_mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->device->fd, nvbo->map_handle); if (bo->map == MAP_FAILED) { bo->map = NULL;