summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-omap-pm/dss2/0126-DSS2-OMAPFB-implement-OMAPFB_GET_VRAM_INFO-ioctl.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2009-07-30 11:19:10 +0200
committerKoen Kooi <koen@openembedded.org>2009-07-30 11:19:10 +0200
commitf2e6ca6bfa79d166ee72224bbb95ca1a71125d43 (patch)
treeb2facdc46191d38b9917a7d390c44f668f19183f /recipes/linux/linux-omap-pm/dss2/0126-DSS2-OMAPFB-implement-OMAPFB_GET_VRAM_INFO-ioctl.patch
parent0501fbe7b6f99eddc8ee9b0d3dab9ebac4722166 (diff)
linux-omap-pm git: add patch for fix musb oops and dss2 patches
Diffstat (limited to 'recipes/linux/linux-omap-pm/dss2/0126-DSS2-OMAPFB-implement-OMAPFB_GET_VRAM_INFO-ioctl.patch')
-rw-r--r--recipes/linux/linux-omap-pm/dss2/0126-DSS2-OMAPFB-implement-OMAPFB_GET_VRAM_INFO-ioctl.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/recipes/linux/linux-omap-pm/dss2/0126-DSS2-OMAPFB-implement-OMAPFB_GET_VRAM_INFO-ioctl.patch b/recipes/linux/linux-omap-pm/dss2/0126-DSS2-OMAPFB-implement-OMAPFB_GET_VRAM_INFO-ioctl.patch
new file mode 100644
index 0000000000..287a82cb81
--- /dev/null
+++ b/recipes/linux/linux-omap-pm/dss2/0126-DSS2-OMAPFB-implement-OMAPFB_GET_VRAM_INFO-ioctl.patch
@@ -0,0 +1,86 @@
+From fbc4a50eafe5d5023ef1c0a32d362c2166946164 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Wed, 24 Jun 2009 14:56:29 +0300
+Subject: [PATCH 126/146] DSS2: OMAPFB: implement OMAPFB_GET_VRAM_INFO ioctl
+
+This ioctl can be used to guess how big buffers it is possible to
+reserve.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-ioctl.c | 18 ++++++++++++++++++
+ include/linux/omapfb.h | 8 ++++++++
+ 2 files changed, 26 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+index 257f7cb..70fb64e 100644
+--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
++++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
+@@ -30,6 +30,7 @@
+
+ #include <mach/display.h>
+ #include <mach/vrfb.h>
++#include <mach/vram.h>
+
+ #include "omapfb.h"
+
+@@ -475,6 +476,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+ enum omapfb_update_mode update_mode;
+ int test_num;
+ struct omapfb_memory_read memory_read;
++ struct omapfb_vram_info vram_info;
+ } p;
+
+ int r = 0;
+@@ -695,6 +697,22 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
+
+ break;
+
++ case OMAPFB_GET_VRAM_INFO: {
++ unsigned long vram, free, largest;
++
++ DBG("ioctl GET_VRAM_INFO\n");
++
++ omap_vram_get_info(&vram, &free, &largest);
++ p.vram_info.total = vram;
++ p.vram_info.free = free;
++ p.vram_info.largest_free_block = largest;
++
++ if (copy_to_user((void __user *)arg, &p.vram_info,
++ sizeof(p.vram_info)))
++ r = -EFAULT;
++ break;
++ }
++
+ default:
+ dev_err(fbdev->dev, "Unknown ioctl 0x%x\n", cmd);
+ r = -EINVAL;
+diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
+index 5014d2e..0df0df9 100644
+--- a/include/linux/omapfb.h
++++ b/include/linux/omapfb.h
+@@ -56,6 +56,7 @@
+ #define OMAPFB_MEMORY_READ OMAP_IOR(58, struct omapfb_memory_read)
+ #define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode)
+ #define OMAPFB_WAITFORGO OMAP_IO(60)
++#define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info)
+
+ #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
+ #define OMAPFB_CAPS_LCDC_MASK 0x00fff000
+@@ -194,6 +195,13 @@ struct omapfb_ovl_colormode {
+ struct fb_bitfield transp;
+ };
+
++struct omapfb_vram_info {
++ __u32 total;
++ __u32 free;
++ __u32 largest_free_block;
++ __u32 reserved[5];
++};
++
+ #ifdef __KERNEL__
+
+ #include <linux/completion.h>
+--
+1.6.2.4
+