From patchwork Mon Mar 5 16:48:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 7096 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1992E23DC3 for ; Mon, 5 Mar 2012 16:49:21 +0000 (UTC) Received: from mail-gx0-f180.google.com (mail-gx0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id DD37EA18183 for ; Mon, 5 Mar 2012 16:49:20 +0000 (UTC) Received: by gglu1 with SMTP id u1so2005452ggl.11 for ; Mon, 05 Mar 2012 08:49:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.45.228 with SMTP id q4mr5020916igm.58.1330966160248; Mon, 05 Mar 2012 08:49:20 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp30887ibg; Mon, 5 Mar 2012 08:49:19 -0800 (PST) Received: by 10.101.152.32 with SMTP id e32mr6982655ano.68.1330966159535; Mon, 05 Mar 2012 08:49:19 -0800 (PST) Received: from mail-yw0-f50.google.com (mail-yw0-f50.google.com [209.85.213.50]) by mx.google.com with ESMTPS id f8si7429530ani.124.2012.03.05.08.49.19 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Mar 2012 08:49:19 -0800 (PST) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.213.50 as permitted sender) client-ip=209.85.213.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.213.50 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-yw0-f50.google.com with SMTP id j63so2040565yhj.37 for ; Mon, 05 Mar 2012 08:49:19 -0800 (PST) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 10.236.185.1 as permitted sender) client-ip=10.236.185.1; Received: from mr.google.com ([10.236.185.1]) by 10.236.185.1 with SMTP id t1mr11281823yhm.37.1330966159384 (num_hops = 1); Mon, 05 Mar 2012 08:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=7ivmt0K3P0Ovfvsj+IZV6I9LQECVT9Sc+n6IA0/P+dE=; b=yGEfYFO4vVTcO3uR99BIKKfi53/GRPBiGcPadPCC8l1kV0e1FMWN3yt5pWpoFKJrsz j7MTihDg0aYn86RJucEPWrsztMYlcDax0Nnncqqsbo6nFJuQHOz1AXpqEhEUalI+WMe+ 5SbGPp0M330kmbbyyHXsugsebGPmP5uO7Xv1w8dUZrxJOmyeRe4NMxGzk8GMlxFc+AFq 52YRQAhzGv/uvUrJ9Ao7VaInMFWD7nijP/DNUAtiyTP7LbR47aVQaAy4/7cFrKs2gHCw Tmp8kuOtjZRYsEz2OK1QkkfQI0fLt2J1fYrSNL95yBWstMvCFOciNkeIq8BP5JGwrlqt zeUQ== Received: by 10.236.185.1 with SMTP id t1mr8830288yhm.37.1330966159334; Mon, 05 Mar 2012 08:49:19 -0800 (PST) Received: from localhost (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id g21sm25359412ani.13.2012.03.05.08.49.18 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Mar 2012 08:49:18 -0800 (PST) Sender: Rob Clark From: Rob Clark To: dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org Cc: patches@linaro.org, Greg KH , Tomi Valkeinen , Andy Gross , Rob Clark Subject: [PATCH 07/10] staging: drm/omap: Disable DMM debugfs for OMAP3 Date: Mon, 5 Mar 2012 10:48:37 -0600 Message-Id: <1330966120-28582-8-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1330966120-28582-1-git-send-email-rob.clark@linaro.org> References: <1330966120-28582-1-git-send-email-rob.clark@linaro.org> X-Gm-Message-State: ALoCoQmYVk+PlJl6T9IzR9C8JIELvrC6oG6sGcJ/0RFzkCUrC3Ki2mDBd00XlmmAwV5GQJiRNZrL From: Andy Gross OMAP3 does not contain a DMM/Tiler block. As such, we should not be exposing any DMM debugfs entries on OMAP3 platforms. Added inline helper function to verify existence of DMM. Signed-off-by: Andy Gross Signed-off-by: Rob Clark --- drivers/staging/omapdrm/omap_debugfs.c | 15 +++++++-------- drivers/staging/omapdrm/omap_dmm_tiler.h | 6 ++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/staging/omapdrm/omap_debugfs.c b/drivers/staging/omapdrm/omap_debugfs.c index e23f907..2f122e0 100644 --- a/drivers/staging/omapdrm/omap_debugfs.c +++ b/drivers/staging/omapdrm/omap_debugfs.c @@ -112,12 +112,10 @@ int omap_debugfs_init(struct drm_minor *minor) return ret; } - /* TODO: only do this if has_dmm.. but this fxn gets called before - * dev_load() so we don't know this yet.. - */ - ret = drm_debugfs_create_files(omap_dmm_debugfs_list, - ARRAY_SIZE(omap_dmm_debugfs_list), - minor->debugfs_root, minor); + if (dmm_is_available()) + ret = drm_debugfs_create_files(omap_dmm_debugfs_list, + ARRAY_SIZE(omap_dmm_debugfs_list), + minor->debugfs_root, minor); if (ret) { dev_err(dev->dev, "could not install omap_dmm_debugfs_list\n"); @@ -131,8 +129,9 @@ void omap_debugfs_cleanup(struct drm_minor *minor) { drm_debugfs_remove_files(omap_debugfs_list, ARRAY_SIZE(omap_debugfs_list), minor); - drm_debugfs_remove_files(omap_dmm_debugfs_list, - ARRAY_SIZE(omap_dmm_debugfs_list), minor); + if (dmm_is_available()) + drm_debugfs_remove_files(omap_dmm_debugfs_list, + ARRAY_SIZE(omap_dmm_debugfs_list), minor); } #endif diff --git a/drivers/staging/omapdrm/omap_dmm_tiler.h b/drivers/staging/omapdrm/omap_dmm_tiler.h index f87cb65..55ab284 100644 --- a/drivers/staging/omapdrm/omap_dmm_tiler.h +++ b/drivers/staging/omapdrm/omap_dmm_tiler.h @@ -16,6 +16,7 @@ #ifndef OMAP_DMM_TILER_H #define OMAP_DMM_TILER_H +#include #include "omap_drv.h" #include "tcm.h" @@ -132,4 +133,9 @@ struct omap_dmm_platform_data { int irq; }; +static inline int dmm_is_available(void) +{ + return cpu_is_omap44xx(); +} + #endif