diff mbox

[v2,07/16] drm: omapdrm: gem: Remove omap_drm_private has_dmm field

Message ID 1450125584-31701-8-git-send-email-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart Dec. 14, 2015, 8:39 p.m. UTC
The field is set to true iff the usergart field is not NULL. Test
usergart instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/omap_drv.c   | 2 +-
 drivers/gpu/drm/omapdrm/omap_drv.h   | 1 -
 drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +-
 drivers/gpu/drm/omapdrm/omap_gem.c   | 5 ++---
 drivers/gpu/drm/omapdrm/omap_plane.c | 2 +-
 5 files changed, 5 insertions(+), 7 deletions(-)

Comments

Tomi Valkeinen Jan. 13, 2016, 5:13 p.m. UTC | #1
On 14/12/15 22:39, Laurent Pinchart wrote:
> The field is set to true iff the usergart field is not NULL. Test
> usergart instead.

That's true, but I don't like the change.

'has_dmm' means we have DMM (well, TILER, really). TILER is used for 1D
and 2D modes. 'usergart' is only for TILER 2D CPU access (if I'm not
mistaken).

I'm not sure what it would buy us or if it's worth the effort, but maybe
we want to make the 2D mode optional in the future.

And even if we do have 2D mode enabled, due to HW issues a 2D mapped
buffer can't really be accessed by the CPU, as it's just too slow. So
maybe we can have 2D mode supported, but without usergart.

I don't know. But I want to keep these things separated.

That said, maybe some of the 'if's would be cleaner if they checked for
usergart instead of has_dmm, if usergart is really what they depend on.

 Tomi
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 69be482e8d47..83d63d71062c 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -303,7 +303,7 @@  static int omap_modeset_init_properties(struct drm_device *dev)
 {
 	struct omap_drm_private *priv = dev->dev_private;
 
-	if (priv->has_dmm) {
+	if (priv->usergart) {
 		dev->mode_config.rotation_property =
 			drm_mode_create_rotation_property(dev,
 				BIT(DRM_ROTATE_0) | BIT(DRM_ROTATE_90) |
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index 718f032aa052..97fcb892fdd7 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -100,7 +100,6 @@  struct omap_drm_private {
 	struct list_head obj_list;
 
 	struct omap_drm_usergart *usergart;
-	bool has_dmm;
 
 	/* properties: */
 	struct drm_property *zorder_prop;
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index db4aa35accfc..9fb15de1207f 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -132,7 +132,7 @@  static int omap_fbdev_create(struct drm_fb_helper *helper,
 			mode_cmd.width * ((sizes->surface_bpp + 7) / 8),
 			mode_cmd.width, sizes->surface_bpp);
 
-	fbdev->ywrap_enabled = priv->has_dmm && ywrap_enabled;
+	fbdev->ywrap_enabled = priv->usergart && ywrap_enabled;
 	if (fbdev->ywrap_enabled) {
 		/* need to align pitch to page size if using DMM scrolling */
 		mode_cmd.pitches[0] = PAGE_ALIGN(mode_cmd.pitches[0]);
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index 391bc7378f9f..8e3b415aa43b 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -787,7 +787,7 @@  int omap_gem_get_paddr(struct drm_gem_object *obj,
 
 	mutex_lock(&obj->dev->struct_mutex);
 
-	if (remap && is_shmem(obj) && priv->has_dmm) {
+	if (remap && is_shmem(obj) && priv->usergart) {
 		if (omap_obj->paddr_cnt == 0) {
 			struct page **pages;
 			uint32_t npages = obj->size >> PAGE_SHIFT;
@@ -1393,7 +1393,7 @@  struct drm_gem_object *omap_gem_new(struct drm_device *dev,
 
 	obj = &omap_obj->base;
 
-	if ((flags & OMAP_BO_SCANOUT) && !priv->has_dmm) {
+	if ((flags & OMAP_BO_SCANOUT) && !priv->usergart) {
 		/* attempt to allocate contiguous memory if we don't
 		 * have DMM for remappign discontiguous buffers
 		 */
@@ -1521,7 +1521,6 @@  void omap_gem_init(struct drm_device *dev)
 	}
 
 	priv->usergart = usergart;
-	priv->has_dmm = true;
 }
 
 void omap_gem_deinit(struct drm_device *dev)
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 11d406b160e1..1c6ec7080f16 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -208,7 +208,7 @@  void omap_plane_install_properties(struct drm_plane *plane,
 	struct drm_device *dev = plane->dev;
 	struct omap_drm_private *priv = dev->dev_private;
 
-	if (priv->has_dmm) {
+	if (priv->usergart) {
 		struct drm_property *prop = dev->mode_config.rotation_property;
 
 		drm_object_attach_property(obj, prop, 0);