aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2011-04-03 22:05:25 -0300
committerAndy Doan <doanac@gmail.com>2011-04-13 15:32:07 -0700
commitd795e2ce653e6c0e622c9b31f91f0c525c5982cb (patch)
tree6b08f85c0505bfda8e2fbfcdbb6c8c87fe879c7c /include/linux
parentcf42e0d832c909f71e58d81238e082791cff1dca (diff)
Adding omap_gpu drm display driver
A DSS based DRM display driver, which provides a plugin interface for 3d/2d accelerators to register. The core driver handles construction of CRTC/encoder/connectors to represent the hardware, and support KMS. This driver replaces omapfb. omap_gpu drm driver allocates framebuffer memory and implements (with the help of drm_fb_helper) the legacy fbdev interface. The driver maps CRTCs to overlays, encoders to overlay-managers, and connectors to dssdev's. To set vram on the command-line (bootargs): omapgpu.vram=0:32M (same syntax as omapfb but use omapgpu module name instead) To set default resolution on command-line, use the normal video= line, such as: video="HDMI Type A-1:800x600@60" And of course, to enable debug: drm.debug=7 The omap_gpu drm driver supports using platform_data to configure which omap_gpu devices are assigned which overlays/managers/devices. If multiple devices are registered, each one creates it's own framebuffer and fbdev. This allows for multiple independent display contexts (like with the old omapfb driver) in cases where you don't want to share one virtual framebuffer across multiple displays. Signed-off-by: Rob Clark <rob@ti.com> Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/omap_gpu.h84
2 files changed, 85 insertions, 0 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index a63b8001b7e..6df617e4248 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -278,6 +278,7 @@ header-y += nl80211.h
header-y += nubus.h
header-y += nvram.h
header-y += omapfb.h
+header-y += omap_gpu.h
header-y += oom.h
header-y += param.h
header-y += parport.h
diff --git a/include/linux/omap_gpu.h b/include/linux/omap_gpu.h
new file mode 100644
index 00000000000..38998698780
--- /dev/null
+++ b/include/linux/omap_gpu.h
@@ -0,0 +1,84 @@
+/*
+ * linux/include/linux/omap_gpu.h
+ *
+ * Copyright (C) 2011 Texas Instruments
+ * Author: Rob Clark <rob@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __OMAP_GPU_H__
+#define __OMAP_GPU_H__
+
+#include <linux/module.h>
+#include <drm/drmP.h>
+
+/* interface that plug-in drivers (for now just PVR) can implement */
+struct omap_gpu_plugin {
+ const char *name;
+
+ /* drm functions */
+ int (*open)(struct drm_device *dev, struct drm_file *file);
+ int (*load)(struct drm_device *dev, unsigned long flags);
+ int (*unload)(struct drm_device *dev);
+ int (*release)(struct drm_device *dev, struct drm_file *file);
+
+ /* file-ops */
+ int (*mmap)(struct file *file, struct vm_area_struct *vma);
+
+ struct drm_ioctl_desc *ioctls;
+ int num_ioctls;
+ int ioctl_start;
+
+ struct list_head list; /* note, this means struct can't be const.. */
+};
+
+int omap_gpu_register_plugin(struct omap_gpu_plugin *plugin);
+int omap_gpu_unregister_plugin(struct omap_gpu_plugin *plugin);
+struct fb_info * omap_gpu_get_fbdev(struct drm_device *dev);
+
+enum omap_dss_update_mode omap_connector_get_update_mode(
+ struct drm_connector *connector);
+int omap_connector_set_update_mode(struct drm_connector *connector,
+ enum omap_dss_update_mode mode);
+int omap_connector_sync(struct drm_connector *connector);
+
+int omap_encoder_wait_for_vsync(struct drm_encoder *encoder);
+
+struct drm_connector * omap_fbdev_get_next_connector(
+ struct fb_info *fbi, struct drm_connector *from);
+void omap_fbdev_flush(struct fb_info *fbi, int x, int y, int w, int h);
+
+struct drm_connector * omap_framebuffer_get_next_connector(
+ struct drm_framebuffer *fb, struct drm_connector *from);
+void omap_framebuffer_flush(struct drm_framebuffer *fb,
+ int x, int y, int w, int h);
+
+
+/* optional platform data to configure the default configuration of which
+ * pipes/overlays/CRTCs are used.. if this is not provided, then instead the
+ * first CONFIG_DRM_OMAP_NUM_CRTCS are used, and they are each connected to
+ * one manager, with priority given to managers that are connected to
+ * detected devices. This should be a good default behavior for most cases,
+ * but yet there still might be times when you wish to do something different.
+ */
+struct omap_gpu_platform_data {
+ int ovl_cnt;
+ const int *ovl_ids;
+ int mgr_cnt;
+ const int *mgr_ids;
+ int dev_cnt;
+ const char **dev_names;
+};
+
+#endif /* __OMAP_GPU_H__ */