linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Clark <rob.clark@linaro.org>
To: dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org
Cc: patches@linaro.org, Greg KH <greg@kroah.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Andy Gross <andy.gross@ti.com>, Rob Clark <rob@ti.com>
Subject: [PATCH 07/10] staging: drm/omap: Disable DMM debugfs for OMAP3
Date: Mon,  5 Mar 2012 10:48:37 -0600	[thread overview]
Message-ID: <1330966120-28582-8-git-send-email-rob.clark@linaro.org> (raw)
In-Reply-To: <1330966120-28582-1-git-send-email-rob.clark@linaro.org>

From: Andy Gross <andy.gross@ti.com>

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 <andy.gross@ti.com>
Signed-off-by: Rob Clark <rob@ti.com>
---
 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 <plat/cpu.h>
 #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
-- 
1.7.5.4


  parent reply	other threads:[~2012-03-05 16:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 16:48 [PATCH 00/10] omapdrm patches for 3.4 Rob Clark
2012-03-05 16:48 ` [PATCH 01/10] staging: drm/omap: get supported color formats from ovl Rob Clark
2012-03-05 16:48 ` [PATCH 02/10] staging: drm/omap: add a workqueue Rob Clark
2012-03-05 16:48 ` [PATCH 03/10] staging: drm/omap: call omap_gem_roll() in non-atomic ctx Rob Clark
2012-03-05 16:48 ` [PATCH 04/10] staging: drm/omap: some minor fb cleanups Rob Clark
2012-03-05 16:48 ` [PATCH 05/10] staging: drm/omap: defer unpin until scanout completes Rob Clark
2012-03-05 16:48 ` [PATCH 06/10] staging: drm/omap: debugfs for object and fb tracking Rob Clark
2012-03-05 16:48 ` Rob Clark [this message]
2012-03-05 16:48 ` [PATCH 08/10] staging: drm/omap: Validate debugfs device Rob Clark
2012-03-05 16:48 ` [PATCH 09/10] staging: drm/omap: Get DMM resources from hwmod Rob Clark
2012-03-05 16:48 ` [PATCH 10/10] staging: drm/omap: mmap of tiled buffers with stride >4kb Rob Clark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1330966120-28582-8-git-send-email-rob.clark@linaro.org \
    --to=rob.clark@linaro.org \
    --cc=andy.gross@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=greg@kroah.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rob@ti.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).