All of lore.kernel.org
 help / color / mirror / Atom feed
From: Archit Taneja <archit@ti.com>
To: tomi.valkeinen@ti.com, robdclark@gmail.com
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH 4/6] drm/omap: Allow allocation of larger buffers
Date: Fri, 11 Apr 2014 12:53:33 +0530	[thread overview]
Message-ID: <1397201015-2807-5-git-send-email-archit@ti.com> (raw)
In-Reply-To: <1397201015-2807-1-git-send-email-archit@ti.com>

The drm ioctl DRM_IOCTL_MODE_ADDFB2 doesn't let us allocate buffers which are
greater than what is specified in the driver through dev->mode_config.

Create helpers for DISPC which return the max manager width and height supported
by the device. The maximum width for a framebuffer is set to the combined width
of the all the crtcs, assuming they are arranged horizontally.

Signed-off-by: Archit Taneja <archit@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 10 ++++++----
 drivers/video/omap2/dss/dispc.c    | 12 ++++++++++++
 include/video/omapdss.h            |  2 ++
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index c8270e4..55ec575 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -306,11 +306,13 @@ static int omap_modeset_init(struct drm_device *dev)
 	dev->mode_config.min_width = 32;
 	dev->mode_config.min_height = 32;
 
-	/* note: eventually will need some cpu_is_omapXYZ() type stuff here
-	 * to fill in these limits properly on different OMAP generations..
+	/*
+	 * Note: the maximum width is set to the combined width of all the
+	 * crtcs. We could assume the same for the maximum height too, but
+	 * we generally don't use such a configuration.
 	 */
-	dev->mode_config.max_width = 2048;
-	dev->mode_config.max_height = 2048;
+	dev->mode_config.max_width = num_crtcs * dispc_mgr_max_width();
+	dev->mode_config.max_height = dispc_mgr_max_height();
 
 	dev->mode_config.funcs = &omap_mode_config_funcs;
 
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 77d6221..47f9829 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2999,6 +2999,18 @@ void dispc_mgr_set_timings(enum omap_channel channel,
 }
 EXPORT_SYMBOL(dispc_mgr_set_timings);
 
+u16 dispc_mgr_max_width(void)
+{
+	return dispc.feat->mgr_width_max;
+}
+EXPORT_SYMBOL(dispc_mgr_max_width);
+
+u16 dispc_mgr_max_height(void)
+{
+	return dispc.feat->mgr_height_max;
+}
+EXPORT_SYMBOL(dispc_mgr_max_height);
+
 static void dispc_mgr_set_lcd_divisor(enum omap_channel channel, u16 lck_div,
 		u16 pck_div)
 {
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 3d7c51a..53637ac 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -949,6 +949,8 @@ void dispc_mgr_set_lcd_config(enum omap_channel channel,
 		const struct dss_lcd_mgr_config *config);
 void dispc_mgr_set_timings(enum omap_channel channel,
 		const struct omap_video_timings *timings);
+u16 dispc_mgr_max_width(void);
+u16 dispc_mgr_max_height(void);
 void dispc_mgr_setup(enum omap_channel channel,
 		const struct omap_overlay_manager_info *info);
 
-- 
1.8.3.2

  parent reply	other threads:[~2014-04-11  7:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11  7:23 [PATCH 0/6] drm/omap: Misc fixes Archit Taneja
2014-04-11  7:23 ` [PATCH 1/6] drm/omap: Fix memory leak in omap_gem_op_async Archit Taneja
2014-04-11  7:23 ` [PATCH 2/6] drm/omap: gem sync: wait on correct events Archit Taneja
2014-04-11  7:23 ` [PATCH 3/6] drm/omap: Fix crash when using LCD3 overlay manager Archit Taneja
2014-04-11  7:23 ` Archit Taneja [this message]
2014-04-14  9:25   ` [PATCH 4/6] drm/omap: Allow allocation of larger buffers Tomi Valkeinen
2014-04-14 10:18     ` Archit Taneja
2014-04-14 10:30       ` Tomi Valkeinen
2014-04-14 11:07         ` Archit Taneja
2014-04-14 10:43   ` Rob Clark
2014-04-11  7:23 ` [PATCH 5/6] drm/omap: Use old_fb to synchronize between successive page flips Archit Taneja
2014-04-11  7:23 ` [PATCH 6/6] drm/omap: protect omap_crtc's event with event_lock spinlock Archit Taneja
2014-04-14 12:36   ` Tomi Valkeinen
2014-04-16  7:06     ` Archit Taneja
2014-04-15  9:42 ` [PATCH 0/6] drm/omap: Misc fixes Tomi Valkeinen

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=1397201015-2807-5-git-send-email-archit@ti.com \
    --to=archit@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robdclark@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.