From be709ebcc26ee31dad215a64180f5e3fc96537c5 Mon Sep 17 00:00:00 2001 From: Ben Widawsky Date: Fri, 1 Feb 2013 16:41:14 -0800 Subject: [PATCH] --- yaml --- r: 358196 b: refs/heads/master c: 7083e05072b88d503d257b6f012ce56367f3ac97 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/DocBook/drm.tmpl | 1 - trunk/drivers/gpu/drm/Kconfig | 2 - trunk/drivers/gpu/drm/Makefile | 1 - trunk/drivers/gpu/drm/ast/ast_fb.c | 26 +- trunk/drivers/gpu/drm/cirrus/cirrus_fbdev.c | 26 +- trunk/drivers/gpu/drm/drm_crtc.c | 18 +- trunk/drivers/gpu/drm/drm_edid.c | 9 +- trunk/drivers/gpu/drm/drm_fb_cma_helper.c | 27 +- trunk/drivers/gpu/drm/drm_fb_helper.c | 251 ++++-------------- trunk/drivers/gpu/drm/drm_pci.c | 54 ++-- .../drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 35 ++- trunk/drivers/gpu/drm/gma500/framebuffer.c | 14 +- trunk/drivers/gpu/drm/i915/i915_reg.h | 4 +- trunk/drivers/gpu/drm/i915/intel_crt.c | 1 + trunk/drivers/gpu/drm/i915/intel_ddi.c | 1 + trunk/drivers/gpu/drm/i915/intel_display.c | 20 +- trunk/drivers/gpu/drm/i915/intel_dp.c | 1 + trunk/drivers/gpu/drm/i915/intel_drv.h | 1 + trunk/drivers/gpu/drm/i915/intel_dvo.c | 1 + trunk/drivers/gpu/drm/i915/intel_fb.c | 21 +- trunk/drivers/gpu/drm/i915/intel_hdmi.c | 1 + trunk/drivers/gpu/drm/i915/intel_lvds.c | 1 + trunk/drivers/gpu/drm/i915/intel_sdvo.c | 1 + trunk/drivers/gpu/drm/i915/intel_tv.c | 1 + trunk/drivers/gpu/drm/mgag200/mgag200_fb.c | 27 +- trunk/drivers/gpu/drm/nouveau/nouveau_bo.c | 1 - trunk/drivers/gpu/drm/nouveau/nouveau_fbcon.c | 25 +- trunk/drivers/gpu/drm/omapdrm/TODO | 23 -- trunk/drivers/gpu/drm/radeon/radeon_fb.c | 25 +- trunk/drivers/gpu/drm/radeon/radeon_ttm.c | 1 - trunk/drivers/gpu/drm/tegra/fb.c | 4 + trunk/drivers/gpu/drm/udl/udl_fb.c | 26 +- trunk/drivers/staging/Kconfig | 2 + trunk/drivers/staging/Makefile | 1 + .../{gpu/drm => staging}/omapdrm/Kconfig | 0 .../{gpu/drm => staging}/omapdrm/Makefile | 0 trunk/drivers/staging/omapdrm/TODO | 32 +++ .../drm => staging}/omapdrm/omap_connector.c | 2 +- .../{gpu/drm => staging}/omapdrm/omap_crtc.c | 14 +- .../drm => staging}/omapdrm/omap_debugfs.c | 16 +- .../drm => staging}/omapdrm/omap_dmm_priv.h | 5 - .../drm => staging}/omapdrm/omap_dmm_tiler.c | 159 +++-------- .../drm => staging}/omapdrm/omap_dmm_tiler.h | 0 .../staging/omapdrm}/omap_drm.h | 2 +- .../{gpu/drm => staging}/omapdrm/omap_drv.c | 16 +- .../{gpu/drm => staging}/omapdrm/omap_drv.h | 8 +- .../drm => staging}/omapdrm/omap_encoder.c | 2 +- .../{gpu/drm => staging}/omapdrm/omap_fb.c | 2 +- .../{gpu/drm => staging}/omapdrm/omap_fbdev.c | 26 +- .../{gpu/drm => staging}/omapdrm/omap_gem.c | 34 +-- .../drm => staging}/omapdrm/omap_gem_dmabuf.c | 8 +- .../omapdrm/omap_gem_helpers.c | 2 +- .../{gpu/drm => staging}/omapdrm/omap_irq.c | 2 +- .../{gpu/drm => staging}/omapdrm/omap_plane.c | 2 +- .../{gpu/drm => staging}/omapdrm/tcm-sita.c | 0 .../{gpu/drm => staging}/omapdrm/tcm-sita.h | 0 .../{gpu/drm => staging}/omapdrm/tcm.h | 2 - trunk/include/drm/drm_crtc.h | 1 - trunk/include/drm/drm_fb_helper.h | 18 +- 60 files changed, 446 insertions(+), 562 deletions(-) delete mode 100644 trunk/drivers/gpu/drm/omapdrm/TODO rename trunk/drivers/{gpu/drm => staging}/omapdrm/Kconfig (100%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/Makefile (100%) create mode 100644 trunk/drivers/staging/omapdrm/TODO rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_connector.c (99%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_crtc.c (98%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_debugfs.c (90%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_dmm_priv.h (96%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_dmm_tiler.c (86%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_dmm_tiler.h (100%) rename trunk/{include/uapi/drm => drivers/staging/omapdrm}/omap_drm.h (99%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_drv.c (97%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_drv.h (98%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_encoder.c (99%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_fb.c (99%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_fbdev.c (95%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_gem.c (97%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_gem_dmabuf.c (98%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_gem_helpers.c (98%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_irq.c (99%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/omap_plane.c (99%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/tcm-sita.c (100%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/tcm-sita.h (100%) rename trunk/drivers/{gpu/drm => staging}/omapdrm/tcm.h (99%) diff --git a/[refs] b/[refs] index d0d6c8ac273b..aa3a98825b31 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 35f8badc1cf652381fa3f82c1fbea39f4dbe87fd +refs/heads/master: 7083e05072b88d503d257b6f012ce56367f3ac97 diff --git a/trunk/Documentation/DocBook/drm.tmpl b/trunk/Documentation/DocBook/drm.tmpl index 51e1904ac4c7..b26de523ab70 100644 --- a/trunk/Documentation/DocBook/drm.tmpl +++ b/trunk/Documentation/DocBook/drm.tmpl @@ -2143,7 +2143,6 @@ void intel_crt_init(struct drm_device *dev) fbdev Helper Functions Reference !Pdrivers/gpu/drm/drm_fb_helper.c fbdev helpers !Edrivers/gpu/drm/drm_fb_helper.c -!Iinclude/drm/drm_fb_helper.h Display Port Helper Functions Reference diff --git a/trunk/drivers/gpu/drm/Kconfig b/trunk/drivers/gpu/drm/Kconfig index 0ce5f52ac56e..ed9e3af17b31 100644 --- a/trunk/drivers/gpu/drm/Kconfig +++ b/trunk/drivers/gpu/drm/Kconfig @@ -215,5 +215,3 @@ source "drivers/gpu/drm/cirrus/Kconfig" source "drivers/gpu/drm/shmobile/Kconfig" source "drivers/gpu/drm/tegra/Kconfig" - -source "drivers/gpu/drm/omapdrm/Kconfig" diff --git a/trunk/drivers/gpu/drm/Makefile b/trunk/drivers/gpu/drm/Makefile index b6b43cbc18e4..6f58c81cfcbc 100644 --- a/trunk/drivers/gpu/drm/Makefile +++ b/trunk/drivers/gpu/drm/Makefile @@ -50,5 +50,4 @@ obj-$(CONFIG_DRM_UDL) += udl/ obj-$(CONFIG_DRM_AST) += ast/ obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/ obj-$(CONFIG_DRM_TEGRA) += tegra/ -obj-$(CONFIG_DRM_OMAP) += omapdrm/ obj-y += i2c/ diff --git a/trunk/drivers/gpu/drm/ast/ast_fb.c b/trunk/drivers/gpu/drm/ast/ast_fb.c index 34931fe7d2c5..3e6584b940dc 100644 --- a/trunk/drivers/gpu/drm/ast/ast_fb.c +++ b/trunk/drivers/gpu/drm/ast/ast_fb.c @@ -40,7 +40,6 @@ #include #include #include -#include #include "ast_drv.h" static void ast_dirty_update(struct ast_fbdev *afbdev, @@ -146,10 +145,9 @@ static int astfb_create_object(struct ast_fbdev *afbdev, return ret; } -static int astfb_create(struct drm_fb_helper *helper, +static int astfb_create(struct ast_fbdev *afbdev, struct drm_fb_helper_surface_size *sizes) { - struct ast_fbdev *afbdev = (struct ast_fbdev *)helper; struct drm_device *dev = afbdev->helper.dev; struct drm_mode_fb_cmd2 mode_cmd; struct drm_framebuffer *fb; @@ -250,10 +248,26 @@ static void ast_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, *blue = ast_crtc->lut_b[regno] << 8; } +static int ast_find_or_create_single(struct drm_fb_helper *helper, + struct drm_fb_helper_surface_size *sizes) +{ + struct ast_fbdev *afbdev = (struct ast_fbdev *)helper; + int new_fb = 0; + int ret; + + if (!helper->fb) { + ret = astfb_create(afbdev, sizes); + if (ret) + return ret; + new_fb = 1; + } + return new_fb; +} + static struct drm_fb_helper_funcs ast_fb_helper_funcs = { .gamma_set = ast_fb_gamma_set, .gamma_get = ast_fb_gamma_get, - .fb_probe = astfb_create, + .fb_probe = ast_find_or_create_single, }; static void ast_fbdev_destroy(struct drm_device *dev, @@ -300,10 +314,6 @@ int ast_fbdev_init(struct drm_device *dev) } drm_fb_helper_single_add_all_connectors(&afbdev->helper); - - /* disable all the possible outputs/crtcs before entering KMS mode */ - drm_helper_disable_unused_functions(dev); - drm_fb_helper_initial_config(&afbdev->helper, 32); return 0; } diff --git a/trunk/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/trunk/drivers/gpu/drm/cirrus/cirrus_fbdev.c index e25afccaf85b..3daea0f638c3 100644 --- a/trunk/drivers/gpu/drm/cirrus/cirrus_fbdev.c +++ b/trunk/drivers/gpu/drm/cirrus/cirrus_fbdev.c @@ -11,7 +11,6 @@ #include #include #include -#include #include @@ -121,10 +120,9 @@ static int cirrusfb_create_object(struct cirrus_fbdev *afbdev, return ret; } -static int cirrusfb_create(struct drm_fb_helper *helper, +static int cirrusfb_create(struct cirrus_fbdev *gfbdev, struct drm_fb_helper_surface_size *sizes) { - struct cirrus_fbdev *gfbdev = (struct cirrus_fbdev *)helper; struct drm_device *dev = gfbdev->helper.dev; struct cirrus_device *cdev = gfbdev->helper.dev->dev_private; struct fb_info *info; @@ -221,6 +219,23 @@ static int cirrusfb_create(struct drm_fb_helper *helper, return ret; } +static int cirrus_fb_find_or_create_single(struct drm_fb_helper *helper, + struct drm_fb_helper_surface_size + *sizes) +{ + struct cirrus_fbdev *gfbdev = (struct cirrus_fbdev *)helper; + int new_fb = 0; + int ret; + + if (!helper->fb) { + ret = cirrusfb_create(gfbdev, sizes); + if (ret) + return ret; + new_fb = 1; + } + return new_fb; +} + static int cirrus_fbdev_destroy(struct drm_device *dev, struct cirrus_fbdev *gfbdev) { @@ -252,7 +267,7 @@ static int cirrus_fbdev_destroy(struct drm_device *dev, static struct drm_fb_helper_funcs cirrus_fb_helper_funcs = { .gamma_set = cirrus_crtc_fb_gamma_set, .gamma_get = cirrus_crtc_fb_gamma_get, - .fb_probe = cirrusfb_create, + .fb_probe = cirrus_fb_find_or_create_single, }; int cirrus_fbdev_init(struct cirrus_device *cdev) @@ -276,9 +291,6 @@ int cirrus_fbdev_init(struct cirrus_device *cdev) return ret; } drm_fb_helper_single_add_all_connectors(&gfbdev->helper); - - /* disable all the possible outputs/crtcs before entering KMS mode */ - drm_helper_disable_unused_functions(cdev->dev); drm_fb_helper_initial_config(&gfbdev->helper, bpp_sel); return 0; diff --git a/trunk/drivers/gpu/drm/drm_crtc.c b/trunk/drivers/gpu/drm/drm_crtc.c index e7471b0880b7..9c797f6fea75 100644 --- a/trunk/drivers/gpu/drm/drm_crtc.c +++ b/trunk/drivers/gpu/drm/drm_crtc.c @@ -68,22 +68,8 @@ void drm_modeset_unlock_all(struct drm_device *dev) mutex_unlock(&dev->mode_config.mutex); } -EXPORT_SYMBOL(drm_modeset_unlock_all); - -/** - * drm_warn_on_modeset_not_all_locked - check that all modeset locks are locked - * @dev: device - */ -void drm_warn_on_modeset_not_all_locked(struct drm_device *dev) -{ - struct drm_crtc *crtc; - list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) - WARN_ON(!mutex_is_locked(&crtc->mutex)); - - WARN_ON(!mutex_is_locked(&dev->mode_config.mutex)); -} -EXPORT_SYMBOL(drm_warn_on_modeset_not_all_locked); +EXPORT_SYMBOL(drm_modeset_unlock_all); /* Avoid boilerplate. I'm tired of typing. */ #define DRM_ENUM_NAME_FN(fnname, list) \ @@ -1996,9 +1982,9 @@ int drm_mode_setplane(struct drm_device *dev, void *data, plane_req->src_w, plane_req->src_h); if (!ret) { old_fb = plane->fb; + fb = NULL; plane->crtc = crtc; plane->fb = fb; - fb = NULL; } drm_modeset_unlock_all(dev); diff --git a/trunk/drivers/gpu/drm/drm_edid.c b/trunk/drivers/gpu/drm/drm_edid.c index 67aa0dd68250..51324256a657 100644 --- a/trunk/drivers/gpu/drm/drm_edid.c +++ b/trunk/drivers/gpu/drm/drm_edid.c @@ -354,14 +354,10 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter) break; } } - - if (i == 4 && print_bad_edid) { + if (i == 4) dev_warn(connector->dev->dev, "%s: Ignoring invalid EDID block %d.\n", drm_get_connector_name(connector), j); - - connector->bad_edid_counter++; - } } if (valid_extensions != block[0x7e]) { @@ -2054,8 +2050,7 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) num_modes += add_cvt_modes(connector, edid); num_modes += add_standard_modes(connector, edid); num_modes += add_established_modes(connector, edid); - if (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF) - num_modes += add_inferred_modes(connector, edid); + num_modes += add_inferred_modes(connector, edid); num_modes += add_cea_modes(connector, edid); if (quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75)) diff --git a/trunk/drivers/gpu/drm/drm_fb_cma_helper.c b/trunk/drivers/gpu/drm/drm_fb_cma_helper.c index 1c8549dae99a..3742bc96421e 100644 --- a/trunk/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/trunk/drivers/gpu/drm/drm_fb_cma_helper.c @@ -275,8 +275,23 @@ static int drm_fbdev_cma_create(struct drm_fb_helper *helper, return ret; } +static int drm_fbdev_cma_probe(struct drm_fb_helper *helper, + struct drm_fb_helper_surface_size *sizes) +{ + int ret = 0; + + if (!helper->fb) { + ret = drm_fbdev_cma_create(helper, sizes); + if (ret < 0) + return ret; + ret = 1; + } + + return ret; +} + static struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = { - .fb_probe = drm_fbdev_cma_create, + .fb_probe = drm_fbdev_cma_probe, }; /** @@ -318,9 +333,6 @@ struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev, } - /* disable all the possible outputs/crtcs before entering KMS mode */ - drm_helper_disable_unused_functions(dev); - ret = drm_fb_helper_initial_config(helper, preferred_bpp); if (ret < 0) { dev_err(dev->dev, "Failed to set inital hw configuration.\n"); @@ -377,13 +389,8 @@ EXPORT_SYMBOL_GPL(drm_fbdev_cma_fini); */ void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma) { - if (fbdev_cma) { - struct drm_device *dev = fbdev_cma->fb_helper.dev; - - drm_modeset_lock_all(dev); + if (fbdev_cma) drm_fb_helper_restore_fbdev_mode(&fbdev_cma->fb_helper); - drm_modeset_unlock_all(dev); - } } EXPORT_SYMBOL_GPL(drm_fbdev_cma_restore_mode); diff --git a/trunk/drivers/gpu/drm/drm_fb_helper.c b/trunk/drivers/gpu/drm/drm_fb_helper.c index 59d6b9bf204b..0c6e25e979dd 100644 --- a/trunk/drivers/gpu/drm/drm_fb_helper.c +++ b/trunk/drivers/gpu/drm/drm_fb_helper.c @@ -52,36 +52,9 @@ static LIST_HEAD(kernel_fb_helper_list); * mode setting driver. They can be used mostly independantely from the crtc * helper functions used by many drivers to implement the kernel mode setting * interfaces. - * - * Initialization is done as a three-step process with drm_fb_helper_init(), - * drm_fb_helper_single_add_all_connectors() and drm_fb_helper_initial_config(). - * Drivers with fancier requirements than the default beheviour can override the - * second step with their own code. Teardown is done with drm_fb_helper_fini(). - * - * At runtime drivers should restore the fbdev console by calling - * drm_fb_helper_restore_fbdev_mode() from their ->lastclose callback. They - * should also notify the fb helper code from updates to the output - * configuration by calling drm_fb_helper_hotplug_event(). For easier - * integration with the output polling code in drm_crtc_helper.c the modeset - * code proves a ->output_poll_changed callback. - * - * All other functions exported by the fb helper library can be used to - * implement the fbdev driver interface by the driver. */ -/** - * drm_fb_helper_single_add_all_connectors() - add all connectors to fbdev - * emulation helper - * @fb_helper: fbdev initialized with drm_fb_helper_init - * - * This functions adds all the available connectors for use with the given - * fb_helper. This is a separate step to allow drivers to freely assign - * connectors to the fbdev, e.g. if some are reserved for special purposes or - * not adequate to be used for the fbcon. - * - * Since this is part of the initial setup before the fbdev is published, no - * locking is required. - */ +/* simple single crtc case helper function */ int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper) { struct drm_device *dev = fb_helper->dev; @@ -190,10 +163,6 @@ static void drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc) crtc->funcs->gamma_set(crtc, r_base, g_base, b_base, 0, crtc->gamma_size); } -/** - * drm_fb_helper_debug_enter - implementation for ->fb_debug_enter - * @info: fbdev registered by the helper - */ int drm_fb_helper_debug_enter(struct fb_info *info) { struct drm_fb_helper *helper = info->par; @@ -239,10 +208,6 @@ static struct drm_framebuffer *drm_mode_config_fb(struct drm_crtc *crtc) return NULL; } -/** - * drm_fb_helper_debug_leave - implementation for ->fb_debug_leave - * @info: fbdev registered by the helper - */ int drm_fb_helper_debug_leave(struct fb_info *info) { struct drm_fb_helper *helper = info->par; @@ -274,21 +239,10 @@ int drm_fb_helper_debug_leave(struct fb_info *info) } EXPORT_SYMBOL(drm_fb_helper_debug_leave); -/** - * drm_fb_helper_restore_fbdev_mode - restore fbdev configuration - * @fb_helper: fbcon to restore - * - * This should be called from driver's drm ->lastclose callback - * when implementing an fbcon on top of kms using this helper. This ensures that - * the user isn't greeted with a black screen when e.g. X dies. - */ bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper) { bool error = false; int i, ret; - - drm_warn_on_modeset_not_all_locked(fb_helper->dev); - for (i = 0; i < fb_helper->crtc_count; i++) { struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set; ret = drm_mode_set_config_internal(mode_set); @@ -299,10 +253,6 @@ bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper) } EXPORT_SYMBOL(drm_fb_helper_restore_fbdev_mode); -/* - * restore fbcon display for all kms driver's using this helper, used for sysrq - * and panic handling. - */ static bool drm_fb_helper_force_kernel_mode(void) { bool ret, error = false; @@ -322,7 +272,7 @@ static bool drm_fb_helper_force_kernel_mode(void) return error; } -static int drm_fb_helper_panic(struct notifier_block *n, unsigned long ununsed, +int drm_fb_helper_panic(struct notifier_block *n, unsigned long ununsed, void *panic_str) { /* @@ -335,11 +285,26 @@ static int drm_fb_helper_panic(struct notifier_block *n, unsigned long ununsed, pr_err("panic occurred, switching back to text console\n"); return drm_fb_helper_force_kernel_mode(); } +EXPORT_SYMBOL(drm_fb_helper_panic); static struct notifier_block paniced = { .notifier_call = drm_fb_helper_panic, }; +/** + * drm_fb_helper_restore - restore the framebuffer console (kernel) config + * + * Restore's the kernel's fbcon mode, used for lastclose & panic paths. + */ +void drm_fb_helper_restore(void) +{ + bool ret; + ret = drm_fb_helper_force_kernel_mode(); + if (ret == true) + DRM_ERROR("Failed to restore crtc configuration\n"); +} +EXPORT_SYMBOL(drm_fb_helper_restore); + static bool drm_fb_helper_is_bound(struct drm_fb_helper *fb_helper) { struct drm_device *dev = fb_helper->dev; @@ -361,10 +326,7 @@ static bool drm_fb_helper_is_bound(struct drm_fb_helper *fb_helper) #ifdef CONFIG_MAGIC_SYSRQ static void drm_fb_helper_restore_work_fn(struct work_struct *ignored) { - bool ret; - ret = drm_fb_helper_force_kernel_mode(); - if (ret == true) - DRM_ERROR("Failed to restore crtc configuration\n"); + drm_fb_helper_restore(); } static DECLARE_WORK(drm_fb_helper_restore_work, drm_fb_helper_restore_work_fn); @@ -390,14 +352,6 @@ static void drm_fb_helper_dpms(struct fb_info *info, int dpms_mode) struct drm_connector *connector; int i, j; - /* - * fbdev->blank can be called from irq context in case of a panic. - * Since we already have our own special panic handler which will - * restore the fbdev console mode completely, just bail out early. - */ - if (oops_in_progress) - return; - /* * For each CRTC in this fb, turn the connectors on/off. */ @@ -424,11 +378,6 @@ static void drm_fb_helper_dpms(struct fb_info *info, int dpms_mode) drm_modeset_unlock_all(dev); } -/** - * drm_fb_helper_blank - implementation for ->fb_blank - * @blank: desired blanking state - * @info: fbdev registered by the helper - */ int drm_fb_helper_blank(int blank, struct fb_info *info) { switch (blank) { @@ -472,24 +421,6 @@ static void drm_fb_helper_crtc_free(struct drm_fb_helper *helper) kfree(helper->crtc_info); } -/** - * drm_fb_helper_init - initialize a drm_fb_helper structure - * @dev: drm device - * @fb_helper: driver-allocated fbdev helper structure to initialize - * @crtc_count: maximum number of crtcs to support in this fbdev emulation - * @max_conn_count: max connector count - * - * This allocates the structures for the fbdev helper with the given limits. - * Note that this won't yet touch the hardware (through the driver interfaces) - * nor register the fbdev. This is only done in drm_fb_helper_initial_config() - * to allow driver writes more control over the exact init sequence. - * - * Drivers must set fb_helper->funcs before calling - * drm_fb_helper_initial_config(). - * - * RETURNS: - * Zero if everything went ok, nonzero otherwise. - */ int drm_fb_helper_init(struct drm_device *dev, struct drm_fb_helper *fb_helper, int crtc_count, int max_conn_count) @@ -618,11 +549,6 @@ static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, return 0; } -/** - * drm_fb_helper_setcmap - implementation for ->fb_setcmap - * @cmap: cmap to set - * @info: fbdev registered by the helper - */ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; @@ -662,11 +588,6 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) } EXPORT_SYMBOL(drm_fb_helper_setcmap); -/** - * drm_fb_helper_check_var - implementation for ->fb_check_var - * @var: screeninfo to check - * @info: fbdev registered by the helper - */ int drm_fb_helper_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { @@ -759,19 +680,13 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var, } EXPORT_SYMBOL(drm_fb_helper_check_var); -/** - * drm_fb_helper_set_par - implementation for ->fb_set_par - * @info: fbdev registered by the helper - * - * This will let fbcon do the mode init and is called at initialization time by - * the fbdev core when registering the driver, and later on through the hotplug - * callback. - */ +/* this will let fbcon do the mode init */ int drm_fb_helper_set_par(struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; struct drm_device *dev = fb_helper->dev; struct fb_var_screeninfo *var = &info->var; + struct drm_crtc *crtc; int ret; int i; @@ -782,6 +697,7 @@ int drm_fb_helper_set_par(struct fb_info *info) drm_modeset_lock_all(dev); for (i = 0; i < fb_helper->crtc_count; i++) { + crtc = fb_helper->crtc_info[i].mode_set.crtc; ret = drm_mode_set_config_internal(&fb_helper->crtc_info[i].mode_set); if (ret) { drm_modeset_unlock_all(dev); @@ -798,11 +714,6 @@ int drm_fb_helper_set_par(struct fb_info *info) } EXPORT_SYMBOL(drm_fb_helper_set_par); -/** - * drm_fb_helper_pan_display - implementation for ->fb_pan_display - * @var: updated screen information - * @info: fbdev registered by the helper - */ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { @@ -840,15 +751,10 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, } EXPORT_SYMBOL(drm_fb_helper_pan_display); -/* - * Allocates the backing storage and sets up the fbdev info structure through - * the ->fb_probe callback and then registers the fbdev and sets up the panic - * notifier. - */ -static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, - int preferred_bpp) +int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, + int preferred_bpp) { - int ret = 0; + int new_fb = 0; int crtc_count = 0; int i; struct fb_info *info; @@ -926,30 +832,27 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, } /* push down into drivers */ - ret = (*fb_helper->funcs->fb_probe)(fb_helper, &sizes); - if (ret < 0) - return ret; + new_fb = (*fb_helper->funcs->fb_probe)(fb_helper, &sizes); + if (new_fb < 0) + return new_fb; info = fb_helper->fbdev; - /* - * Set the fb pointer - usually drm_setup_crtcs does this for hotplug - * events, but at init time drm_setup_crtcs needs to be called before - * the fb is allocated (since we need to figure out the desired size of - * the fb before we can allocate it ...). Hence we need to fix things up - * here again. - */ + /* set the fb pointer */ for (i = 0; i < fb_helper->crtc_count; i++) - if (fb_helper->crtc_info[i].mode_set.num_connectors) - fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; + fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; + if (new_fb) { + info->var.pixclock = 0; + if (register_framebuffer(info) < 0) + return -EINVAL; - info->var.pixclock = 0; - if (register_framebuffer(info) < 0) - return -EINVAL; + dev_info(fb_helper->dev->dev, "fb%d: %s frame buffer device\n", + info->node, info->fix.id); - dev_info(fb_helper->dev->dev, "fb%d: %s frame buffer device\n", - info->node, info->fix.id); + } else { + drm_fb_helper_set_par(info); + } /* Switch back to kernel console on panic */ /* multi card linked list maybe */ @@ -959,25 +862,13 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, &paniced); register_sysrq_key('v', &sysrq_drm_fb_helper_restore_op); } - - list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list); + if (new_fb) + list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list); return 0; } +EXPORT_SYMBOL(drm_fb_helper_single_fb_probe); -/** - * drm_fb_helper_fill_fix - initializes fixed fbdev information - * @info: fbdev registered by the helper - * @pitch: desired pitch - * @depth: desired depth - * - * Helper to fill in the fixed fbdev information useful for a non-accelerated - * fbdev emulations. Drivers which support acceleration methods which impose - * additional constraints need to set up their own limits. - * - * Drivers should call this (or their equivalent setup code) from their - * ->fb_probe callback. - */ void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, uint32_t depth) { @@ -998,20 +889,6 @@ void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, } EXPORT_SYMBOL(drm_fb_helper_fill_fix); -/** - * drm_fb_helper_fill_var - initalizes variable fbdev information - * @info: fbdev instance to set up - * @fb_helper: fb helper instance to use as template - * @fb_width: desired fb width - * @fb_height: desired fb height - * - * Sets up the variable fbdev metainformation from the given fb helper instance - * and the drm framebuffer allocated in fb_helper->fb. - * - * Drivers should call this (or their equivalent setup code) from their - * ->fb_probe callback after having allocated the fbdev backing - * storage framebuffer. - */ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, uint32_t fb_width, uint32_t fb_height) { @@ -1435,7 +1312,6 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper) for (i = 0; i < fb_helper->crtc_count; i++) { modeset = &fb_helper->crtc_info[i].mode_set; modeset->num_connectors = 0; - modeset->fb = NULL; } for (i = 0; i < fb_helper->connector_count; i++) { @@ -1452,21 +1328,9 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper) modeset->mode = drm_mode_duplicate(dev, fb_crtc->desired_mode); modeset->connectors[modeset->num_connectors++] = fb_helper->connector_info[i]->connector; - modeset->fb = fb_helper->fb; } } - /* Clear out any old modes if there are no more connected outputs. */ - for (i = 0; i < fb_helper->crtc_count; i++) { - modeset = &fb_helper->crtc_info[i].mode_set; - if (modeset->num_connectors == 0) { - BUG_ON(modeset->fb); - BUG_ON(modeset->num_connectors); - if (modeset->mode) - drm_mode_destroy(dev, modeset->mode); - modeset->mode = NULL; - } - } out: kfree(crtcs); kfree(modes); @@ -1474,23 +1338,18 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper) } /** - * drm_fb_helper_initial_config - setup a sane initial connector configuration + * drm_helper_initial_config - setup a sane initial connector configuration * @fb_helper: fb_helper device struct * @bpp_sel: bpp value to use for the framebuffer configuration * + * LOCKING: + * Called at init time by the driver to set up the @fb_helper initial + * configuration, must take the mode config lock. + * * Scans the CRTCs and connectors and tries to put together an initial setup. * At the moment, this is a cloned configuration across all heads with * a new framebuffer object as the backing store. * - * Note that this also registers the fbdev and so allows userspace to call into - * the driver through the fbdev interfaces. - * - * This function will call down into the ->fb_probe callback to let - * the driver allocate and initialize the fbdev info structure and the drm - * framebuffer used to back the fbdev. drm_fb_helper_fill_var() and - * drm_fb_helper_fill_fix() are provided as helpers to setup simple default - * values for the fbdev info structure. - * * RETURNS: * Zero if everything went ok, nonzero otherwise. */ @@ -1499,6 +1358,9 @@ bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel) struct drm_device *dev = fb_helper->dev; int count = 0; + /* disable all the possible outputs/crtcs before entering KMS mode */ + drm_helper_disable_unused_functions(fb_helper->dev); + drm_fb_helper_parse_command_line(fb_helper); count = drm_fb_helper_probe_connector_modes(fb_helper, @@ -1521,17 +1383,12 @@ EXPORT_SYMBOL(drm_fb_helper_initial_config); * probing all the outputs attached to the fb * @fb_helper: the drm_fb_helper * + * LOCKING: + * Called at runtime, must take mode config lock. + * * Scan the connectors attached to the fb_helper and try to put together a * setup after *notification of a change in output configuration. * - * Called at runtime, takes the mode config locks to be able to check/change the - * modeset configuration. Must be run from process context (which usually means - * either the output polling work or a work item launched from the driver's - * hotplug interrupt). - * - * Note that the driver must ensure that this is only called _after_ the fb has - * been fully set up, i.e. after the call to drm_fb_helper_initial_config. - * * RETURNS: * 0 on success and a non-zero error code otherwise. */ @@ -1561,9 +1418,7 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) drm_setup_crtcs(fb_helper); drm_modeset_unlock_all(dev); - drm_fb_helper_set_par(fb_helper->fbdev); - - return 0; + return drm_fb_helper_single_fb_probe(fb_helper, bpp_sel); } EXPORT_SYMBOL(drm_fb_helper_hotplug_event); diff --git a/trunk/drivers/gpu/drm/drm_pci.c b/trunk/drivers/gpu/drm/drm_pci.c index bd719e936e13..86102a08f65c 100644 --- a/trunk/drivers/gpu/drm/drm_pci.c +++ b/trunk/drivers/gpu/drm/drm_pci.c @@ -439,6 +439,33 @@ int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver) return 0; } +#else + +int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver) +{ + return -1; +} + +#endif + +EXPORT_SYMBOL(drm_pci_init); + +/*@}*/ +void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver) +{ + struct drm_device *dev, *tmp; + DRM_DEBUG("\n"); + + if (driver->driver_features & DRIVER_MODESET) { + pci_unregister_driver(pdriver); + } else { + list_for_each_entry_safe(dev, tmp, &driver->device_list, driver_item) + drm_put_dev(dev); + } + DRM_INFO("Module unloaded\n"); +} +EXPORT_SYMBOL(drm_pci_exit); + int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask) { struct pci_dev *root; @@ -476,30 +503,3 @@ int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask) return 0; } EXPORT_SYMBOL(drm_pcie_get_speed_cap_mask); - -#else - -int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver) -{ - return -1; -} - -#endif - -EXPORT_SYMBOL(drm_pci_init); - -/*@}*/ -void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver) -{ - struct drm_device *dev, *tmp; - DRM_DEBUG("\n"); - - if (driver->driver_features & DRIVER_MODESET) { - pci_unregister_driver(pdriver); - } else { - list_for_each_entry_safe(dev, tmp, &driver->device_list, driver_item) - drm_put_dev(dev); - } - DRM_INFO("Module unloaded\n"); -} -EXPORT_SYMBOL(drm_pci_exit); diff --git a/trunk/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/trunk/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 68f0045f86b8..90d335cfb8c0 100644 --- a/trunk/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/trunk/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -226,8 +226,36 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, return ret; } +static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper, + struct drm_fb_helper_surface_size *sizes) +{ + int ret = 0; + + DRM_DEBUG_KMS("%s\n", __FILE__); + + /* + * with !helper->fb, it means that this funcion is called first time + * and after that, the helper->fb would be used as clone mode. + */ + if (!helper->fb) { + ret = exynos_drm_fbdev_create(helper, sizes); + if (ret < 0) { + DRM_ERROR("failed to create fbdev.\n"); + return ret; + } + + /* + * fb_helper expects a value more than 1 if succeed + * because register_framebuffer() should be called. + */ + ret = 1; + } + + return ret; +} + static struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = { - .fb_probe = exynos_drm_fbdev_create, + .fb_probe = exynos_drm_fbdev_probe, }; int exynos_drm_fbdev_init(struct drm_device *dev) @@ -267,9 +295,6 @@ int exynos_drm_fbdev_init(struct drm_device *dev) } - /* disable all the possible outputs/crtcs before entering KMS mode */ - drm_helper_disable_unused_functions(dev); - ret = drm_fb_helper_initial_config(helper, PREFERRED_BPP); if (ret < 0) { DRM_ERROR("failed to set up hw configuration.\n"); @@ -351,7 +376,5 @@ void exynos_drm_fbdev_restore_mode(struct drm_device *dev) if (!private || !private->fb_helper) return; - drm_modeset_lock_all(dev); drm_fb_helper_restore_fbdev_mode(private->fb_helper); - drm_modeset_unlock_all(dev); } diff --git a/trunk/drivers/gpu/drm/gma500/framebuffer.c b/trunk/drivers/gpu/drm/gma500/framebuffer.c index 2590cac84257..c1ef37e2efdf 100644 --- a/trunk/drivers/gpu/drm/gma500/framebuffer.c +++ b/trunk/drivers/gpu/drm/gma500/framebuffer.c @@ -545,7 +545,9 @@ static int psbfb_probe(struct drm_fb_helper *helper, struct psb_fbdev *psb_fbdev = (struct psb_fbdev *)helper; struct drm_device *dev = psb_fbdev->psb_fb_helper.dev; struct drm_psb_private *dev_priv = dev->dev_private; + int new_fb = 0; int bytespp; + int ret; bytespp = sizes->surface_bpp / 8; if (bytespp == 3) /* no 24bit packed */ @@ -560,7 +562,13 @@ static int psbfb_probe(struct drm_fb_helper *helper, sizes->surface_depth = 16; } - return psbfb_create(psb_fbdev, sizes); + if (!helper->fb) { + ret = psbfb_create(psb_fbdev, sizes); + if (ret) + return ret; + new_fb = 1; + } + return new_fb; } static struct drm_fb_helper_funcs psb_fb_helper_funcs = { @@ -608,10 +616,6 @@ int psb_fbdev_init(struct drm_device *dev) INTELFB_CONN_LIMIT); drm_fb_helper_single_add_all_connectors(&fbdev->psb_fb_helper); - - /* disable all the possible outputs/crtcs before entering KMS mode */ - drm_helper_disable_unused_functions(dev); - drm_fb_helper_initial_config(&fbdev->psb_fb_helper, 32); return 0; } diff --git a/trunk/drivers/gpu/drm/i915/i915_reg.h b/trunk/drivers/gpu/drm/i915/i915_reg.h index 15f5e7f9cded..8754f9160aef 100644 --- a/trunk/drivers/gpu/drm/i915/i915_reg.h +++ b/trunk/drivers/gpu/drm/i915/i915_reg.h @@ -4272,8 +4272,8 @@ #define GEN6_PCODE_READ_MIN_FREQ_TABLE 0x9 #define GEN6_PCODE_WRITE_RC6VIDS 0x4 #define GEN6_PCODE_READ_RC6VIDS 0x5 -#define GEN6_ENCODE_RC6_VID(mv) (((mv) / 5) - 245) < 0 ?: 0 -#define GEN6_DECODE_RC6_VID(vids) (((vids) * 5) > 0 ? ((vids) * 5) + 245 : 0) +#define GEN6_ENCODE_RC6_VID(mv) (((mv) - 245) / 5) +#define GEN6_DECODE_RC6_VID(vids) (((vids) * 5) + 245) #define GEN6_PCODE_DATA 0x138128 #define GEN6_PCODE_FREQ_IA_RATIO_SHIFT 8 diff --git a/trunk/drivers/gpu/drm/i915/intel_crt.c b/trunk/drivers/gpu/drm/i915/intel_crt.c index 729dd1a3fe72..68e79f32e100 100644 --- a/trunk/drivers/gpu/drm/i915/intel_crt.c +++ b/trunk/drivers/gpu/drm/i915/intel_crt.c @@ -685,6 +685,7 @@ static void intel_crt_reset(struct drm_connector *connector) static const struct drm_encoder_helper_funcs crt_encoder_funcs = { .mode_fixup = intel_crt_mode_fixup, .mode_set = intel_crt_mode_set, + .disable = intel_encoder_noop, }; static const struct drm_connector_funcs intel_crt_connector_funcs = { diff --git a/trunk/drivers/gpu/drm/i915/intel_ddi.c b/trunk/drivers/gpu/drm/i915/intel_ddi.c index a259e09eb6a8..cedf4ab5ff16 100644 --- a/trunk/drivers/gpu/drm/i915/intel_ddi.c +++ b/trunk/drivers/gpu/drm/i915/intel_ddi.c @@ -1481,6 +1481,7 @@ static const struct drm_encoder_funcs intel_ddi_funcs = { static const struct drm_encoder_helper_funcs intel_ddi_helper_funcs = { .mode_fixup = intel_ddi_mode_fixup, .mode_set = intel_ddi_mode_set, + .disable = intel_encoder_noop, }; void intel_ddi_init(struct drm_device *dev, enum port port) diff --git a/trunk/drivers/gpu/drm/i915/intel_display.c b/trunk/drivers/gpu/drm/i915/intel_display.c index ca8d5929063e..0dfecaf599ff 100644 --- a/trunk/drivers/gpu/drm/i915/intel_display.c +++ b/trunk/drivers/gpu/drm/i915/intel_display.c @@ -3718,6 +3718,10 @@ void intel_crtc_update_dpms(struct drm_crtc *crtc) intel_crtc_update_sarea(crtc, enable); } +static void intel_crtc_noop(struct drm_crtc *crtc) +{ +} + static void intel_crtc_disable(struct drm_crtc *crtc) { struct drm_device *dev = crtc->dev; @@ -3766,6 +3770,10 @@ void intel_modeset_disable(struct drm_device *dev) } } +void intel_encoder_noop(struct drm_encoder *encoder) +{ +} + void intel_encoder_destroy(struct drm_encoder *encoder) { struct intel_encoder *intel_encoder = to_intel_encoder(encoder); @@ -7269,6 +7277,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, static struct drm_crtc_helper_funcs intel_helper_funcs = { .mode_set_base_atomic = intel_pipe_set_base_atomic, .load_lut = intel_crtc_load_lut, + .disable = intel_crtc_noop, }; bool intel_encoder_check_is_cloned(struct intel_encoder *encoder) @@ -7978,9 +7987,14 @@ static int intel_crtc_set_config(struct drm_mode_set *set) BUG_ON(!set->crtc); BUG_ON(!set->crtc->helper_private); - /* Enforce sane interface api - has been abused by the fb helper. */ - BUG_ON(!set->mode && set->fb); - BUG_ON(set->fb && set->num_connectors == 0); + if (!set->mode) + set->fb = NULL; + + /* The fb helper likes to play gross jokes with ->mode_set_config. + * Unfortunately the crtc helper doesn't do much at all for this case, + * so we have to cope with this madness until the fb helper is fixed up. */ + if (set->fb && set->num_connectors == 0) + return 0; if (set->fb) { DRM_DEBUG_KMS("[CRTC:%d] [FB:%d] #connectors=%d (x y) (%i %i)\n", diff --git a/trunk/drivers/gpu/drm/i915/intel_dp.c b/trunk/drivers/gpu/drm/i915/intel_dp.c index 13c1536a8bb2..56e408b2e3c8 100644 --- a/trunk/drivers/gpu/drm/i915/intel_dp.c +++ b/trunk/drivers/gpu/drm/i915/intel_dp.c @@ -2561,6 +2561,7 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder) static const struct drm_encoder_helper_funcs intel_dp_helper_funcs = { .mode_fixup = intel_dp_mode_fixup, .mode_set = intel_dp_mode_set, + .disable = intel_encoder_noop, }; static const struct drm_connector_funcs intel_dp_connector_funcs = { diff --git a/trunk/drivers/gpu/drm/i915/intel_drv.h b/trunk/drivers/gpu/drm/i915/intel_drv.h index a2ec01c49f40..13afb37d8dec 100644 --- a/trunk/drivers/gpu/drm/i915/intel_drv.h +++ b/trunk/drivers/gpu/drm/i915/intel_drv.h @@ -521,6 +521,7 @@ extern void intel_modeset_disable(struct drm_device *dev); extern void intel_crtc_restore_mode(struct drm_crtc *crtc); extern void intel_crtc_load_lut(struct drm_crtc *crtc); extern void intel_crtc_update_dpms(struct drm_crtc *crtc); +extern void intel_encoder_noop(struct drm_encoder *encoder); extern void intel_encoder_destroy(struct drm_encoder *encoder); extern void intel_encoder_dpms(struct intel_encoder *encoder, int mode); extern bool intel_encoder_check_is_cloned(struct intel_encoder *encoder); diff --git a/trunk/drivers/gpu/drm/i915/intel_dvo.c b/trunk/drivers/gpu/drm/i915/intel_dvo.c index 00e70dbe82da..15da99533e5b 100644 --- a/trunk/drivers/gpu/drm/i915/intel_dvo.c +++ b/trunk/drivers/gpu/drm/i915/intel_dvo.c @@ -345,6 +345,7 @@ static void intel_dvo_destroy(struct drm_connector *connector) static const struct drm_encoder_helper_funcs intel_dvo_helper_funcs = { .mode_fixup = intel_dvo_mode_fixup, .mode_set = intel_dvo_mode_set, + .disable = intel_encoder_noop, }; static const struct drm_connector_funcs intel_dvo_connector_funcs = { diff --git a/trunk/drivers/gpu/drm/i915/intel_fb.c b/trunk/drivers/gpu/drm/i915/intel_fb.c index 981bdce3634e..1c510da04d16 100644 --- a/trunk/drivers/gpu/drm/i915/intel_fb.c +++ b/trunk/drivers/gpu/drm/i915/intel_fb.c @@ -57,10 +57,9 @@ static struct fb_ops intelfb_ops = { .fb_debug_leave = drm_fb_helper_debug_leave, }; -static int intelfb_create(struct drm_fb_helper *helper, +static int intelfb_create(struct intel_fbdev *ifbdev, struct drm_fb_helper_surface_size *sizes) { - struct intel_fbdev *ifbdev = (struct intel_fbdev *)helper; struct drm_device *dev = ifbdev->helper.dev; struct drm_i915_private *dev_priv = dev->dev_private; struct fb_info *info; @@ -182,10 +181,26 @@ static int intelfb_create(struct drm_fb_helper *helper, return ret; } +static int intel_fb_find_or_create_single(struct drm_fb_helper *helper, + struct drm_fb_helper_surface_size *sizes) +{ + struct intel_fbdev *ifbdev = (struct intel_fbdev *)helper; + int new_fb = 0; + int ret; + + if (!helper->fb) { + ret = intelfb_create(ifbdev, sizes); + if (ret) + return ret; + new_fb = 1; + } + return new_fb; +} + static struct drm_fb_helper_funcs intel_fb_helper_funcs = { .gamma_set = intel_crtc_fb_gamma_set, .gamma_get = intel_crtc_fb_gamma_get, - .fb_probe = intelfb_create, + .fb_probe = intel_fb_find_or_create_single, }; static void intel_fbdev_destroy(struct drm_device *dev, diff --git a/trunk/drivers/gpu/drm/i915/intel_hdmi.c b/trunk/drivers/gpu/drm/i915/intel_hdmi.c index 3883bed80faa..5b4efd64c2f9 100644 --- a/trunk/drivers/gpu/drm/i915/intel_hdmi.c +++ b/trunk/drivers/gpu/drm/i915/intel_hdmi.c @@ -972,6 +972,7 @@ static void intel_hdmi_destroy(struct drm_connector *connector) static const struct drm_encoder_helper_funcs intel_hdmi_helper_funcs = { .mode_fixup = intel_hdmi_mode_fixup, .mode_set = intel_hdmi_mode_set, + .disable = intel_encoder_noop, }; static const struct drm_connector_funcs intel_hdmi_connector_funcs = { diff --git a/trunk/drivers/gpu/drm/i915/intel_lvds.c b/trunk/drivers/gpu/drm/i915/intel_lvds.c index feb43fd7debf..5e3f08e3fd8b 100644 --- a/trunk/drivers/gpu/drm/i915/intel_lvds.c +++ b/trunk/drivers/gpu/drm/i915/intel_lvds.c @@ -656,6 +656,7 @@ static int intel_lvds_set_property(struct drm_connector *connector, static const struct drm_encoder_helper_funcs intel_lvds_helper_funcs = { .mode_fixup = intel_lvds_mode_fixup, .mode_set = intel_lvds_mode_set, + .disable = intel_encoder_noop, }; static const struct drm_connector_helper_funcs intel_lvds_connector_helper_funcs = { diff --git a/trunk/drivers/gpu/drm/i915/intel_sdvo.c b/trunk/drivers/gpu/drm/i915/intel_sdvo.c index 33b46d9694ea..f01063a2323a 100644 --- a/trunk/drivers/gpu/drm/i915/intel_sdvo.c +++ b/trunk/drivers/gpu/drm/i915/intel_sdvo.c @@ -2043,6 +2043,7 @@ intel_sdvo_set_property(struct drm_connector *connector, static const struct drm_encoder_helper_funcs intel_sdvo_helper_funcs = { .mode_fixup = intel_sdvo_mode_fixup, .mode_set = intel_sdvo_mode_set, + .disable = intel_encoder_noop, }; static const struct drm_connector_funcs intel_sdvo_connector_funcs = { diff --git a/trunk/drivers/gpu/drm/i915/intel_tv.c b/trunk/drivers/gpu/drm/i915/intel_tv.c index d808421c1c80..984a113c5d13 100644 --- a/trunk/drivers/gpu/drm/i915/intel_tv.c +++ b/trunk/drivers/gpu/drm/i915/intel_tv.c @@ -1487,6 +1487,7 @@ intel_tv_set_property(struct drm_connector *connector, struct drm_property *prop static const struct drm_encoder_helper_funcs intel_tv_helper_funcs = { .mode_fixup = intel_tv_mode_fixup, .mode_set = intel_tv_mode_set, + .disable = intel_encoder_noop, }; static const struct drm_connector_funcs intel_tv_connector_funcs = { diff --git a/trunk/drivers/gpu/drm/mgag200/mgag200_fb.c b/trunk/drivers/gpu/drm/mgag200/mgag200_fb.c index d2253f639481..5c69b432f99a 100644 --- a/trunk/drivers/gpu/drm/mgag200/mgag200_fb.c +++ b/trunk/drivers/gpu/drm/mgag200/mgag200_fb.c @@ -13,7 +13,6 @@ #include #include #include -#include #include @@ -121,10 +120,9 @@ static int mgag200fb_create_object(struct mga_fbdev *afbdev, return ret; } -static int mgag200fb_create(struct drm_fb_helper *helper, +static int mgag200fb_create(struct mga_fbdev *mfbdev, struct drm_fb_helper_surface_size *sizes) { - struct mga_fbdev *mfbdev = (struct mga_fbdev *)helper; struct drm_device *dev = mfbdev->helper.dev; struct drm_mode_fb_cmd2 mode_cmd; struct mga_device *mdev = dev->dev_private; @@ -211,6 +209,23 @@ static int mgag200fb_create(struct drm_fb_helper *helper, return ret; } +static int mga_fb_find_or_create_single(struct drm_fb_helper *helper, + struct drm_fb_helper_surface_size + *sizes) +{ + struct mga_fbdev *mfbdev = (struct mga_fbdev *)helper; + int new_fb = 0; + int ret; + + if (!helper->fb) { + ret = mgag200fb_create(mfbdev, sizes); + if (ret) + return ret; + new_fb = 1; + } + return new_fb; +} + static int mga_fbdev_destroy(struct drm_device *dev, struct mga_fbdev *mfbdev) { @@ -241,7 +256,7 @@ static int mga_fbdev_destroy(struct drm_device *dev, static struct drm_fb_helper_funcs mga_fb_helper_funcs = { .gamma_set = mga_crtc_fb_gamma_set, .gamma_get = mga_crtc_fb_gamma_get, - .fb_probe = mgag200fb_create, + .fb_probe = mga_fb_find_or_create_single, }; int mgag200_fbdev_init(struct mga_device *mdev) @@ -263,10 +278,6 @@ int mgag200_fbdev_init(struct mga_device *mdev) return ret; } drm_fb_helper_single_add_all_connectors(&mfbdev->helper); - - /* disable all the possible outputs/crtcs before entering KMS mode */ - drm_helper_disable_unused_functions(mdev->dev); - drm_fb_helper_initial_config(&mfbdev->helper, 32); return 0; diff --git a/trunk/drivers/gpu/drm/nouveau/nouveau_bo.c b/trunk/drivers/gpu/drm/nouveau/nouveau_bo.c index 2f2741483b51..64d6e3047dee 100644 --- a/trunk/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/trunk/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -28,7 +28,6 @@ */ #include -#include #include #include diff --git a/trunk/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/trunk/drivers/gpu/drm/nouveau/nouveau_fbcon.c index b03531781580..d4ecb4deb484 100644 --- a/trunk/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/trunk/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -251,10 +251,9 @@ nouveau_fbcon_zfill(struct drm_device *dev, struct nouveau_fbdev *fbcon) } static int -nouveau_fbcon_create(struct drm_fb_helper *helper, +nouveau_fbcon_create(struct nouveau_fbdev *fbcon, struct drm_fb_helper_surface_size *sizes) { - struct nouveau_fbdev *fbcon = (struct nouveau_fbdev *)helper; struct drm_device *dev = fbcon->dev; struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_device *device = nv_device(drm->device); @@ -389,6 +388,23 @@ nouveau_fbcon_create(struct drm_fb_helper *helper, return ret; } +static int +nouveau_fbcon_find_or_create_single(struct drm_fb_helper *helper, + struct drm_fb_helper_surface_size *sizes) +{ + struct nouveau_fbdev *fbcon = (struct nouveau_fbdev *)helper; + int new_fb = 0; + int ret; + + if (!helper->fb) { + ret = nouveau_fbcon_create(fbcon, sizes); + if (ret) + return ret; + new_fb = 1; + } + return new_fb; +} + void nouveau_fbcon_output_poll_changed(struct drm_device *dev) { @@ -434,7 +450,7 @@ void nouveau_fbcon_gpu_lockup(struct fb_info *info) static struct drm_fb_helper_funcs nouveau_fbcon_helper_funcs = { .gamma_set = nouveau_fbcon_gamma_set, .gamma_get = nouveau_fbcon_gamma_get, - .fb_probe = nouveau_fbcon_create, + .fb_probe = nouveau_fbcon_find_or_create_single, }; @@ -475,9 +491,6 @@ nouveau_fbcon_init(struct drm_device *dev) else preferred_bpp = 32; - /* disable all the possible outputs/crtcs before entering KMS mode */ - drm_helper_disable_unused_functions(dev); - drm_fb_helper_initial_config(&fbcon->helper, preferred_bpp); return 0; } diff --git a/trunk/drivers/gpu/drm/omapdrm/TODO b/trunk/drivers/gpu/drm/omapdrm/TODO deleted file mode 100644 index 4d8c18aa5dd7..000000000000 --- a/trunk/drivers/gpu/drm/omapdrm/TODO +++ /dev/null @@ -1,23 +0,0 @@ -TODO -. Where should we do eviction (detatch_pages())? We aren't necessarily - accessing the pages via a GART, so maybe we need some other threshold - to put a cap on the # of pages that can be pin'd. - . Use mm_shrinker to trigger unpinning pages. - . This is mainly theoretical since most of these devices don't actually - have swap or harddrive. -. GEM/shmem backed pages can have existing mappings (kernel linear map, - etc..), which isn't really ideal. -. Revisit GEM sync object infrastructure.. TTM has some framework for this - already. Possibly this could be refactored out and made more common? - There should be some way to do this with less wheel-reinvention. - . This can be handled by the dma-buf fence/reservation stuff when it - lands - -Userspace: -. git://anongit.freedesktop.org/xorg/driver/xf86-video-omap - -Currently tested on -. OMAP3530 beagleboard -. OMAP4430 pandaboard -. OMAP4460 pandaboard -. OMAP5432 uEVM diff --git a/trunk/drivers/gpu/drm/radeon/radeon_fb.c b/trunk/drivers/gpu/drm/radeon/radeon_fb.c index b1746741bc59..515e5ee1f9ee 100644 --- a/trunk/drivers/gpu/drm/radeon/radeon_fb.c +++ b/trunk/drivers/gpu/drm/radeon/radeon_fb.c @@ -187,10 +187,9 @@ static int radeonfb_create_pinned_object(struct radeon_fbdev *rfbdev, return ret; } -static int radeonfb_create(struct drm_fb_helper *helper, +static int radeonfb_create(struct radeon_fbdev *rfbdev, struct drm_fb_helper_surface_size *sizes) { - struct radeon_fbdev *rfbdev = (struct radeon_fbdev *)helper; struct radeon_device *rdev = rfbdev->rdev; struct fb_info *info; struct drm_framebuffer *fb = NULL; @@ -301,6 +300,22 @@ static int radeonfb_create(struct drm_fb_helper *helper, return ret; } +static int radeon_fb_find_or_create_single(struct drm_fb_helper *helper, + struct drm_fb_helper_surface_size *sizes) +{ + struct radeon_fbdev *rfbdev = (struct radeon_fbdev *)helper; + int new_fb = 0; + int ret; + + if (!helper->fb) { + ret = radeonfb_create(rfbdev, sizes); + if (ret) + return ret; + new_fb = 1; + } + return new_fb; +} + void radeon_fb_output_poll_changed(struct radeon_device *rdev) { drm_fb_helper_hotplug_event(&rdev->mode_info.rfbdev->helper); @@ -334,7 +349,7 @@ static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfb static struct drm_fb_helper_funcs radeon_fb_helper_funcs = { .gamma_set = radeon_crtc_fb_gamma_set, .gamma_get = radeon_crtc_fb_gamma_get, - .fb_probe = radeonfb_create, + .fb_probe = radeon_fb_find_or_create_single, }; int radeon_fbdev_init(struct radeon_device *rdev) @@ -364,10 +379,6 @@ int radeon_fbdev_init(struct radeon_device *rdev) } drm_fb_helper_single_add_all_connectors(&rfbdev->helper); - - /* disable all the possible outputs/crtcs before entering KMS mode */ - drm_helper_disable_unused_functions(rdev->ddev); - drm_fb_helper_initial_config(&rfbdev->helper, bpp_sel); return 0; } diff --git a/trunk/drivers/gpu/drm/radeon/radeon_ttm.c b/trunk/drivers/gpu/drm/radeon/radeon_ttm.c index 93f760e27a92..1d8ff2f850ba 100644 --- a/trunk/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/trunk/drivers/gpu/drm/radeon/radeon_ttm.c @@ -38,7 +38,6 @@ #include #include #include -#include #include "radeon_reg.h" #include "radeon.h" diff --git a/trunk/drivers/gpu/drm/tegra/fb.c b/trunk/drivers/gpu/drm/tegra/fb.c index 03914953cb1c..97993c6835fd 100644 --- a/trunk/drivers/gpu/drm/tegra/fb.c +++ b/trunk/drivers/gpu/drm/tegra/fb.c @@ -39,6 +39,10 @@ int tegra_drm_fb_init(struct drm_device *drm) if (IS_ERR(fbdev)) return PTR_ERR(fbdev); +#ifndef CONFIG_FRAMEBUFFER_CONSOLE + drm_fbdev_cma_restore_mode(fbdev); +#endif + host1x->fbdev = fbdev; return 0; diff --git a/trunk/drivers/gpu/drm/udl/udl_fb.c b/trunk/drivers/gpu/drm/udl/udl_fb.c index 9f4be3d4a02e..b9feec9d08d3 100644 --- a/trunk/drivers/gpu/drm/udl/udl_fb.c +++ b/trunk/drivers/gpu/drm/udl/udl_fb.c @@ -476,10 +476,9 @@ udl_framebuffer_init(struct drm_device *dev, } -static int udlfb_create(struct drm_fb_helper *helper, +static int udlfb_create(struct udl_fbdev *ufbdev, struct drm_fb_helper_surface_size *sizes) { - struct udl_fbdev *ufbdev = (struct udl_fbdev *)helper; struct drm_device *dev = ufbdev->helper.dev; struct fb_info *info; struct device *device = &dev->usbdev->dev; @@ -557,10 +556,27 @@ static int udlfb_create(struct drm_fb_helper *helper, return ret; } +static int udl_fb_find_or_create_single(struct drm_fb_helper *helper, + struct drm_fb_helper_surface_size *sizes) +{ + struct udl_fbdev *ufbdev = (struct udl_fbdev *)helper; + int new_fb = 0; + int ret; + + if (!helper->fb) { + ret = udlfb_create(ufbdev, sizes); + if (ret) + return ret; + + new_fb = 1; + } + return new_fb; +} + static struct drm_fb_helper_funcs udl_fb_helper_funcs = { .gamma_set = udl_crtc_fb_gamma_set, .gamma_get = udl_crtc_fb_gamma_get, - .fb_probe = udlfb_create, + .fb_probe = udl_fb_find_or_create_single, }; static void udl_fbdev_destroy(struct drm_device *dev, @@ -603,10 +619,6 @@ int udl_fbdev_init(struct drm_device *dev) } drm_fb_helper_single_add_all_connectors(&ufbdev->helper); - - /* disable all the possible outputs/crtcs before entering KMS mode */ - drm_helper_disable_unused_functions(dev); - drm_fb_helper_initial_config(&ufbdev->helper, bpp_sel); return 0; } diff --git a/trunk/drivers/staging/Kconfig b/trunk/drivers/staging/Kconfig index eca907bf8b6d..329bdb42109f 100644 --- a/trunk/drivers/staging/Kconfig +++ b/trunk/drivers/staging/Kconfig @@ -114,6 +114,8 @@ source "drivers/staging/media/Kconfig" source "drivers/staging/net/Kconfig" +source "drivers/staging/omapdrm/Kconfig" + source "drivers/staging/android/Kconfig" source "drivers/staging/ozwpan/Kconfig" diff --git a/trunk/drivers/staging/Makefile b/trunk/drivers/staging/Makefile index d810ed729add..c7ec486680f7 100644 --- a/trunk/drivers/staging/Makefile +++ b/trunk/drivers/staging/Makefile @@ -49,6 +49,7 @@ obj-$(CONFIG_SPEAKUP) += speakup/ obj-$(CONFIG_TOUCHSCREEN_CLEARPAD_TM1217) += cptm1217/ obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4) += ste_rmi4/ obj-$(CONFIG_MFD_NVEC) += nvec/ +obj-$(CONFIG_DRM_OMAP) += omapdrm/ obj-$(CONFIG_ANDROID) += android/ obj-$(CONFIG_USB_WPAN_HCD) += ozwpan/ obj-$(CONFIG_USB_G_CCG) += ccg/ diff --git a/trunk/drivers/gpu/drm/omapdrm/Kconfig b/trunk/drivers/staging/omapdrm/Kconfig similarity index 100% rename from trunk/drivers/gpu/drm/omapdrm/Kconfig rename to trunk/drivers/staging/omapdrm/Kconfig diff --git a/trunk/drivers/gpu/drm/omapdrm/Makefile b/trunk/drivers/staging/omapdrm/Makefile similarity index 100% rename from trunk/drivers/gpu/drm/omapdrm/Makefile rename to trunk/drivers/staging/omapdrm/Makefile diff --git a/trunk/drivers/staging/omapdrm/TODO b/trunk/drivers/staging/omapdrm/TODO new file mode 100644 index 000000000000..abeeb00aaa12 --- /dev/null +++ b/trunk/drivers/staging/omapdrm/TODO @@ -0,0 +1,32 @@ +TODO +. add video decode/encode support (via syslink3 + codec-engine) + . NOTE: with dmabuf this probably could be split into different driver + so perhaps this TODO doesn't belong here +. where should we do eviction (detatch_pages())? We aren't necessarily + accessing the pages via a GART, so maybe we need some other threshold + to put a cap on the # of pages that can be pin'd. (It is mostly only + of interest in case you have a swap partition/file.. which a lot of + these devices do not.. but it doesn't hurt for the driver to do the + right thing anyways.) + . Use mm_shrinker to trigger unpinning pages. Need to figure out how + to handle next issue first (I think?) + . Note TTM already has some mm_shrinker stuff.. maybe an argument to + move to TTM? Or maybe something that could be factored out in common? +. GEM/shmem backed pages can have existing mappings (kernel linear map, + etc..), which isn't really ideal. +. Revisit GEM sync object infrastructure.. TTM has some framework for this + already. Possibly this could be refactored out and made more common? + There should be some way to do this with less wheel-reinvention. +. Solve PM sequencing on resume. DMM/TILER must be reloaded before any + access is made from any component in the system. Which means on suspend + CRTC's should be disabled, and on resume the LUT should be reprogrammed + before CRTC's are re-enabled, to prevent DSS from trying to DMA from a + buffer mapped in DMM/TILER before LUT is reloaded. + +Userspace: +. git://github.com/robclark/xf86-video-omap.git + +Currently tested on +. OMAP3530 beagleboard +. OMAP4430 pandaboard +. OMAP4460 pandaboard diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_connector.c b/trunk/drivers/staging/omapdrm/omap_connector.c similarity index 99% rename from trunk/drivers/gpu/drm/omapdrm/omap_connector.c rename to trunk/drivers/staging/omapdrm/omap_connector.c index 44284fd981fc..4cc9ee733c5f 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_connector.c +++ b/trunk/drivers/staging/omapdrm/omap_connector.c @@ -1,5 +1,5 @@ /* - * drivers/gpu/drm/omapdrm/omap_connector.c + * drivers/staging/omapdrm/omap_connector.c * * Copyright (C) 2011 Texas Instruments * Author: Rob Clark diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_crtc.c b/trunk/drivers/staging/omapdrm/omap_crtc.c similarity index 98% rename from trunk/drivers/gpu/drm/omapdrm/omap_crtc.c rename to trunk/drivers/staging/omapdrm/omap_crtc.c index ac2258f59805..510942e67020 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/trunk/drivers/staging/omapdrm/omap_crtc.c @@ -1,5 +1,5 @@ /* - * drivers/gpu/drm/omapdrm/omap_crtc.c + * drivers/staging/omapdrm/omap_crtc.c * * Copyright (C) 2011 Texas Instruments * Author: Rob Clark @@ -274,16 +274,17 @@ static void page_flip_worker(struct work_struct *work) struct omap_crtc *omap_crtc = container_of(work, struct omap_crtc, page_flip_work); struct drm_crtc *crtc = &omap_crtc->base; + struct drm_device *dev = crtc->dev; struct drm_display_mode *mode = &crtc->mode; struct drm_gem_object *bo; - mutex_lock(&crtc->mutex); + drm_modeset_lock_all(dev); omap_plane_mode_set(omap_crtc->plane, crtc, crtc->fb, 0, 0, mode->hdisplay, mode->vdisplay, crtc->x << 16, crtc->y << 16, mode->hdisplay << 16, mode->vdisplay << 16, vblank_cb, crtc); - mutex_unlock(&crtc->mutex); + drm_modeset_unlock_all(dev); bo = omap_framebuffer_bo(crtc->fb, 0); drm_gem_object_unreference_unlocked(bo); @@ -416,7 +417,7 @@ static void apply_worker(struct work_struct *work) * the callbacks and list modification all serialized * with respect to modesetting ioctls from userspace. */ - mutex_lock(&crtc->mutex); + drm_modeset_lock_all(dev); dispc_runtime_get(); /* @@ -461,15 +462,16 @@ static void apply_worker(struct work_struct *work) out: dispc_runtime_put(); - mutex_unlock(&crtc->mutex); + drm_modeset_unlock_all(dev); } int omap_crtc_apply(struct drm_crtc *crtc, struct omap_drm_apply *apply) { struct omap_crtc *omap_crtc = to_omap_crtc(crtc); + struct drm_device *dev = crtc->dev; - WARN_ON(!mutex_is_locked(&crtc->mutex)); + WARN_ON(!mutex_is_locked(&dev->mode_config.mutex)); /* no need to queue it again if it is already queued: */ if (apply->queued) diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_debugfs.c b/trunk/drivers/staging/omapdrm/omap_debugfs.c similarity index 90% rename from trunk/drivers/gpu/drm/omapdrm/omap_debugfs.c rename to trunk/drivers/staging/omapdrm/omap_debugfs.c index c27f59da7f29..e95540b3e2f6 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_debugfs.c +++ b/trunk/drivers/staging/omapdrm/omap_debugfs.c @@ -1,5 +1,5 @@ /* - * drivers/gpu/drm/omapdrm/omap_debugfs.c + * drivers/staging/omapdrm/omap_debugfs.c * * Copyright (C) 2011 Texas Instruments * Author: Rob Clark @@ -57,6 +57,17 @@ static int fb_show(struct seq_file *m, void *arg) struct drm_device *dev = node->minor->dev; struct omap_drm_private *priv = dev->dev_private; struct drm_framebuffer *fb; + int ret; + + ret = mutex_lock_interruptible(&dev->mode_config.mutex); + if (ret) + return ret; + + ret = mutex_lock_interruptible(&dev->struct_mutex); + if (ret) { + mutex_unlock(&dev->mode_config.mutex); + return ret; + } seq_printf(m, "fbcon "); omap_framebuffer_describe(priv->fbdev->fb, m); @@ -71,6 +82,9 @@ static int fb_show(struct seq_file *m, void *arg) } mutex_unlock(&dev->mode_config.fb_lock); + mutex_unlock(&dev->struct_mutex); + mutex_unlock(&dev->mode_config.mutex); + return 0; } diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_dmm_priv.h b/trunk/drivers/staging/omapdrm/omap_dmm_priv.h similarity index 96% rename from trunk/drivers/gpu/drm/omapdrm/omap_dmm_priv.h rename to trunk/drivers/staging/omapdrm/omap_dmm_priv.h index 58bcd6ae0255..273ec12c028a 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_dmm_priv.h +++ b/trunk/drivers/staging/omapdrm/omap_dmm_priv.h @@ -118,11 +118,6 @@ struct pat { #define DESCR_SIZE 128 #define REFILL_BUFFER_SIZE ((4 * 128 * 256) + (3 * DESCR_SIZE)) -/* For OMAP5, a fixed offset is added to all Y coordinates for 1D buffers. - * This is used in programming to address the upper portion of the LUT -*/ -#define OMAP5_LUT_OFFSET 128 - struct dmm; struct dmm_txn { diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/trunk/drivers/staging/omapdrm/omap_dmm_tiler.c similarity index 86% rename from trunk/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c rename to trunk/drivers/staging/omapdrm/omap_dmm_tiler.c index 391021537105..59bf43899fc0 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +++ b/trunk/drivers/staging/omapdrm/omap_dmm_tiler.c @@ -213,11 +213,6 @@ static void dmm_txn_append(struct dmm_txn *txn, struct pat_area *area, txn->last_pat->next_pa = (uint32_t)pat_pa; pat->area = *area; - - /* adjust Y coordinates based off of container parameters */ - pat->area.y0 += engine->tcm->y_offset; - pat->area.y1 += engine->tcm->y_offset; - pat->ctrl = (struct pat_ctrl){ .start = 1, .lut_id = engine->tcm->lut_id, @@ -627,11 +622,6 @@ static int omap_dmm_probe(struct platform_device *dev) omap_dmm->lut_width = ((pat_geom >> 16) & 0xF) << 5; omap_dmm->lut_height = ((pat_geom >> 24) & 0xF) << 5; - /* increment LUT by one if on OMAP5 */ - /* LUT has twice the height, and is split into a separate container */ - if (omap_dmm->lut_height != omap_dmm->container_height) - omap_dmm->num_lut++; - /* initialize DMM registers */ writel(0x88888888, omap_dmm->base + DMM_PAT_VIEW__0); writel(0x88888888, omap_dmm->base + DMM_PAT_VIEW__1); @@ -711,9 +701,6 @@ static int omap_dmm_probe(struct platform_device *dev) } /* init containers */ - /* Each LUT is associated with a TCM (container manager). We use the - lut_id to denote the lut_id used to identify the correct LUT for - programming during reill operations */ for (i = 0; i < omap_dmm->num_lut; i++) { omap_dmm->tcm[i] = sita_init(omap_dmm->container_width, omap_dmm->container_height, @@ -730,23 +717,13 @@ static int omap_dmm_probe(struct platform_device *dev) /* assign access mode containers to applicable tcm container */ /* OMAP 4 has 1 container for all 4 views */ - /* OMAP 5 has 2 containers, 1 for 2D and 1 for 1D */ containers[TILFMT_8BIT] = omap_dmm->tcm[0]; containers[TILFMT_16BIT] = omap_dmm->tcm[0]; containers[TILFMT_32BIT] = omap_dmm->tcm[0]; - - if (omap_dmm->container_height != omap_dmm->lut_height) { - /* second LUT is used for PAGE mode. Programming must use - y offset that is added to all y coordinates. LUT id is still - 0, because it is the same LUT, just the upper 128 lines */ - containers[TILFMT_PAGE] = omap_dmm->tcm[1]; - omap_dmm->tcm[1]->y_offset = OMAP5_LUT_OFFSET; - omap_dmm->tcm[1]->lut_id = 0; - } else { - containers[TILFMT_PAGE] = omap_dmm->tcm[0]; - } + containers[TILFMT_PAGE] = omap_dmm->tcm[0]; area = (struct tcm_area) { + .is2d = true, .tcm = NULL, .p1.x = omap_dmm->container_width - 1, .p1.y = omap_dmm->container_height - 1, @@ -858,81 +835,64 @@ int tiler_map_show(struct seq_file *s, void *arg) int h_adj; int w_adj; unsigned long flags; - int lut_idx; - if (!omap_dmm) { /* early return if dmm/tiler device is not initialized */ return 0; } - h_adj = omap_dmm->container_height / ydiv; - w_adj = omap_dmm->container_width / xdiv; + h_adj = omap_dmm->lut_height / ydiv; + w_adj = omap_dmm->lut_width / xdiv; - map = kmalloc(h_adj * sizeof(*map), GFP_KERNEL); - global_map = kmalloc((w_adj + 1) * h_adj, GFP_KERNEL); + map = kzalloc(h_adj * sizeof(*map), GFP_KERNEL); + global_map = kzalloc((w_adj + 1) * h_adj, GFP_KERNEL); if (!map || !global_map) goto error; - for (lut_idx = 0; lut_idx < omap_dmm->num_lut; lut_idx++) { - memset(map, 0, sizeof(h_adj * sizeof(*map))); - memset(global_map, ' ', (w_adj + 1) * h_adj); - - for (i = 0; i < omap_dmm->container_height; i++) { - map[i] = global_map + i * (w_adj + 1); - map[i][w_adj] = 0; - } - - spin_lock_irqsave(&list_lock, flags); + memset(global_map, ' ', (w_adj + 1) * h_adj); + for (i = 0; i < omap_dmm->lut_height; i++) { + map[i] = global_map + i * (w_adj + 1); + map[i][w_adj] = 0; + } + spin_lock_irqsave(&list_lock, flags); - list_for_each_entry(block, &omap_dmm->alloc_head, alloc_node) { - if (block->area.tcm == omap_dmm->tcm[lut_idx]) { - if (block->fmt != TILFMT_PAGE) { - fill_map(map, xdiv, ydiv, &block->area, - *m2dp, true); - if (!*++a2dp) - a2dp = a2d; - if (!*++m2dp) - m2dp = m2d; - map_2d_info(map, xdiv, ydiv, nice, - &block->area); - } else { - bool start = read_map_pt(map, xdiv, - ydiv, &block->area.p0) == ' '; - bool end = read_map_pt(map, xdiv, ydiv, - &block->area.p1) == ' '; - - tcm_for_each_slice(a, block->area, p) - fill_map(map, xdiv, ydiv, &a, - '=', true); - fill_map_pt(map, xdiv, ydiv, - &block->area.p0, + list_for_each_entry(block, &omap_dmm->alloc_head, alloc_node) { + if (block->fmt != TILFMT_PAGE) { + fill_map(map, xdiv, ydiv, &block->area, *m2dp, true); + if (!*++a2dp) + a2dp = a2d; + if (!*++m2dp) + m2dp = m2d; + map_2d_info(map, xdiv, ydiv, nice, &block->area); + } else { + bool start = read_map_pt(map, xdiv, ydiv, + &block->area.p0) + == ' '; + bool end = read_map_pt(map, xdiv, ydiv, &block->area.p1) + == ' '; + tcm_for_each_slice(a, block->area, p) + fill_map(map, xdiv, ydiv, &a, '=', true); + fill_map_pt(map, xdiv, ydiv, &block->area.p0, start ? '<' : 'X'); - fill_map_pt(map, xdiv, ydiv, - &block->area.p1, + fill_map_pt(map, xdiv, ydiv, &block->area.p1, end ? '>' : 'X'); - map_1d_info(map, xdiv, ydiv, nice, - &block->area); - } - } + map_1d_info(map, xdiv, ydiv, nice, &block->area); } + } - spin_unlock_irqrestore(&list_lock, flags); + spin_unlock_irqrestore(&list_lock, flags); - if (s) { - seq_printf(s, "CONTAINER %d DUMP BEGIN\n", lut_idx); - for (i = 0; i < 128; i++) - seq_printf(s, "%03d:%s\n", i, map[i]); - seq_printf(s, "CONTAINER %d DUMP END\n", lut_idx); - } else { - dev_dbg(omap_dmm->dev, "CONTAINER %d DUMP BEGIN\n", - lut_idx); - for (i = 0; i < 128; i++) - dev_dbg(omap_dmm->dev, "%03d:%s\n", i, map[i]); - dev_dbg(omap_dmm->dev, "CONTAINER %d DUMP END\n", - lut_idx); - } + if (s) { + seq_printf(s, "BEGIN DMM TILER MAP\n"); + for (i = 0; i < 128; i++) + seq_printf(s, "%03d:%s\n", i, map[i]); + seq_printf(s, "END TILER MAP\n"); + } else { + dev_dbg(omap_dmm->dev, "BEGIN DMM TILER MAP\n"); + for (i = 0; i < 128; i++) + dev_dbg(omap_dmm->dev, "%03d:%s\n", i, map[i]); + dev_dbg(omap_dmm->dev, "END TILER MAP\n"); } error: @@ -943,45 +903,12 @@ int tiler_map_show(struct seq_file *s, void *arg) } #endif -#ifdef CONFIG_PM -static int omap_dmm_resume(struct device *dev) -{ - struct tcm_area area; - int i; - - if (!omap_dmm) - return -ENODEV; - - area = (struct tcm_area) { - .tcm = NULL, - .p1.x = omap_dmm->container_width - 1, - .p1.y = omap_dmm->container_height - 1, - }; - - /* initialize all LUTs to dummy page entries */ - for (i = 0; i < omap_dmm->num_lut; i++) { - area.tcm = omap_dmm->tcm[i]; - if (fill(&area, NULL, 0, 0, true)) - dev_err(dev, "refill failed"); - } - - return 0; -} - -static const struct dev_pm_ops omap_dmm_pm_ops = { - .resume = omap_dmm_resume, -}; -#endif - struct platform_driver omap_dmm_driver = { .probe = omap_dmm_probe, .remove = omap_dmm_remove, .driver = { .owner = THIS_MODULE, .name = DMM_DRIVER_NAME, -#ifdef CONFIG_PM - .pm = &omap_dmm_pm_ops, -#endif }, }; diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_dmm_tiler.h b/trunk/drivers/staging/omapdrm/omap_dmm_tiler.h similarity index 100% rename from trunk/drivers/gpu/drm/omapdrm/omap_dmm_tiler.h rename to trunk/drivers/staging/omapdrm/omap_dmm_tiler.h diff --git a/trunk/include/uapi/drm/omap_drm.h b/trunk/drivers/staging/omapdrm/omap_drm.h similarity index 99% rename from trunk/include/uapi/drm/omap_drm.h rename to trunk/drivers/staging/omapdrm/omap_drm.h index 1d0b1172664e..f0ac34a8973e 100644 --- a/trunk/include/uapi/drm/omap_drm.h +++ b/trunk/drivers/staging/omapdrm/omap_drm.h @@ -1,5 +1,5 @@ /* - * include/uapi/drm/omap_drm.h + * include/drm/omap_drm.h * * Copyright (C) 2011 Texas Instruments * Author: Rob Clark diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_drv.c b/trunk/drivers/staging/omapdrm/omap_drv.c similarity index 97% rename from trunk/drivers/gpu/drm/omapdrm/omap_drv.c rename to trunk/drivers/staging/omapdrm/omap_drv.c index 9083538bd16a..dfdb4ba1e7c6 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/trunk/drivers/staging/omapdrm/omap_drv.c @@ -1,5 +1,5 @@ /* - * drivers/gpu/drm/omapdrm/omap_drv.c + * drivers/staging/omapdrm/omap_drv.c * * Copyright (C) 2011 Texas Instruments * Author: Rob Clark @@ -368,9 +368,6 @@ static int dev_load(struct drm_device *dev, unsigned long flags) /* well, limp along without an fbdev.. maybe X11 will work? */ } - /* store off drm_device for use in pm ops */ - dev_set_drvdata(dev->dev, dev); - drm_kms_helper_poll_init(dev); return 0; @@ -396,8 +393,6 @@ static int dev_unload(struct drm_device *dev) kfree(dev->dev_private); dev->dev_private = NULL; - dev_set_drvdata(dev->dev, NULL); - return 0; } @@ -563,19 +558,10 @@ static int pdev_remove(struct platform_device *device) return 0; } -#ifdef CONFIG_PM -static const struct dev_pm_ops omapdrm_pm_ops = { - .resume = omap_gem_resume, -}; -#endif - struct platform_driver pdev = { .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, -#ifdef CONFIG_PM - .pm = &omapdrm_pm_ops, -#endif }, .probe = pdev_probe, .remove = pdev_remove, diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_drv.h b/trunk/drivers/staging/omapdrm/omap_drv.h similarity index 98% rename from trunk/drivers/gpu/drm/omapdrm/omap_drv.h rename to trunk/drivers/staging/omapdrm/omap_drv.h index d4f997bb4ac0..cd1f22b0b124 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_drv.h +++ b/trunk/drivers/staging/omapdrm/omap_drv.h @@ -1,5 +1,5 @@ /* - * drivers/gpu/drm/omapdrm/omap_drv.h + * drivers/staging/omapdrm/omap_drv.h * * Copyright (C) 2011 Texas Instruments * Author: Rob Clark @@ -25,8 +25,8 @@ #include #include #include -#include #include +#include "omap_drm.h" #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__) @@ -135,10 +135,6 @@ void omap_gem_describe(struct drm_gem_object *obj, struct seq_file *m); void omap_gem_describe_objects(struct list_head *list, struct seq_file *m); #endif -#ifdef CONFIG_PM -int omap_gem_resume(struct device *dev); -#endif - int omap_irq_enable_vblank(struct drm_device *dev, int crtc); void omap_irq_disable_vblank(struct drm_device *dev, int crtc); irqreturn_t omap_irq_handler(DRM_IRQ_ARGS); diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_encoder.c b/trunk/drivers/staging/omapdrm/omap_encoder.c similarity index 99% rename from trunk/drivers/gpu/drm/omapdrm/omap_encoder.c rename to trunk/drivers/staging/omapdrm/omap_encoder.c index 7e1f2ab65372..e053160d2db3 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_encoder.c +++ b/trunk/drivers/staging/omapdrm/omap_encoder.c @@ -1,5 +1,5 @@ /* - * drivers/gpu/drm/omapdrm/omap_encoder.c + * drivers/staging/omapdrm/omap_encoder.c * * Copyright (C) 2011 Texas Instruments * Author: Rob Clark diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_fb.c b/trunk/drivers/staging/omapdrm/omap_fb.c similarity index 99% rename from trunk/drivers/gpu/drm/omapdrm/omap_fb.c rename to trunk/drivers/staging/omapdrm/omap_fb.c index 9d5f6f696c72..bf6421f26c40 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/trunk/drivers/staging/omapdrm/omap_fb.c @@ -1,5 +1,5 @@ /* - * drivers/gpu/drm/omapdrm/omap_fb.c + * drivers/staging/omapdrm/omap_fb.c * * Copyright (C) 2011 Texas Instruments * Author: Rob Clark diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_fbdev.c b/trunk/drivers/staging/omapdrm/omap_fbdev.c similarity index 95% rename from trunk/drivers/gpu/drm/omapdrm/omap_fbdev.c rename to trunk/drivers/staging/omapdrm/omap_fbdev.c index f0033bd3e4ae..2728e37e02be 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/trunk/drivers/staging/omapdrm/omap_fbdev.c @@ -1,5 +1,5 @@ /* - * drivers/gpu/drm/omapdrm/omap_fbdev.c + * drivers/staging/omapdrm/omap_fbdev.c * * Copyright (C) 2011 Texas Instruments * Author: Rob Clark @@ -131,6 +131,9 @@ static struct fb_ops omap_fb_ops = { .fb_pan_display = omap_fbdev_pan_display, .fb_blank = drm_fb_helper_blank, .fb_setcmap = drm_fb_helper_setcmap, + + .fb_debug_enter = drm_fb_helper_debug_enter, + .fb_debug_leave = drm_fb_helper_debug_leave, }; static int omap_fbdev_create(struct drm_fb_helper *helper, @@ -293,10 +296,25 @@ static void omap_crtc_fb_gamma_get(struct drm_crtc *crtc, DBG("fbdev: get gamma"); } +static int omap_fbdev_probe(struct drm_fb_helper *helper, + struct drm_fb_helper_surface_size *sizes) +{ + int new_fb = 0; + int ret; + + if (!helper->fb) { + ret = omap_fbdev_create(helper, sizes); + if (ret) + return ret; + new_fb = 1; + } + return new_fb; +} + static struct drm_fb_helper_funcs omap_fb_helper_funcs = { .gamma_set = omap_crtc_fb_gamma_set, .gamma_get = omap_crtc_fb_gamma_get, - .fb_probe = omap_fbdev_create, + .fb_probe = omap_fbdev_probe, }; static struct drm_fb_helper *get_fb(struct fb_info *fbi) @@ -351,10 +369,6 @@ struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev) } drm_fb_helper_single_add_all_connectors(helper); - - /* disable all the possible outputs/crtcs before entering KMS mode */ - drm_helper_disable_unused_functions(dev); - drm_fb_helper_initial_config(helper, 32); priv->fbdev = helper; diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_gem.c b/trunk/drivers/staging/omapdrm/omap_gem.c similarity index 97% rename from trunk/drivers/gpu/drm/omapdrm/omap_gem.c rename to trunk/drivers/staging/omapdrm/omap_gem.c index e8302b02691d..c38992b76fc9 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/trunk/drivers/staging/omapdrm/omap_gem.c @@ -1,5 +1,5 @@ /* - * drivers/gpu/drm/omapdrm/omap_gem.c + * drivers/staging/omapdrm/omap_gem.c * * Copyright (C) 2011 Texas Instruments * Author: Rob Clark @@ -964,34 +964,6 @@ void *omap_gem_vaddr(struct drm_gem_object *obj) return omap_obj->vaddr; } -#ifdef CONFIG_PM -/* re-pin objects in DMM in resume path: */ -int omap_gem_resume(struct device *dev) -{ - struct drm_device *drm_dev = dev_get_drvdata(dev); - struct omap_drm_private *priv = drm_dev->dev_private; - struct omap_gem_object *omap_obj; - int ret = 0; - - list_for_each_entry(omap_obj, &priv->obj_list, mm_list) { - if (omap_obj->block) { - struct drm_gem_object *obj = &omap_obj->base; - uint32_t npages = obj->size >> PAGE_SHIFT; - WARN_ON(!omap_obj->pages); /* this can't happen */ - ret = tiler_pin(omap_obj->block, - omap_obj->pages, npages, - omap_obj->roll, true); - if (ret) { - dev_err(dev, "could not repin: %d\n", ret); - return ret; - } - } - } - - return 0; -} -#endif - #ifdef CONFIG_DEBUG_FS void omap_gem_describe(struct drm_gem_object *obj, struct seq_file *m) { @@ -1267,12 +1239,12 @@ int omap_gem_set_sync_object(struct drm_gem_object *obj, void *syncobj) if ((omap_obj->flags & OMAP_BO_EXT_SYNC) && !syncobj) { /* clearing a previously set syncobj */ - syncobj = kmemdup(omap_obj->sync, sizeof(*omap_obj->sync), - GFP_ATOMIC); + syncobj = kzalloc(sizeof(*omap_obj->sync), GFP_ATOMIC); if (!syncobj) { ret = -ENOMEM; goto unlock; } + memcpy(syncobj, omap_obj->sync, sizeof(*omap_obj->sync)); omap_obj->flags &= ~OMAP_BO_EXT_SYNC; omap_obj->sync = syncobj; } else if (syncobj && !(omap_obj->flags & OMAP_BO_EXT_SYNC)) { diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c b/trunk/drivers/staging/omapdrm/omap_gem_dmabuf.c similarity index 98% rename from trunk/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c rename to trunk/drivers/staging/omapdrm/omap_gem_dmabuf.c index ac74d1bc67bf..b6c5b5c6c8c5 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c +++ b/trunk/drivers/staging/omapdrm/omap_gem_dmabuf.c @@ -1,5 +1,5 @@ /* - * drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c + * drivers/staging/omapdrm/omap_gem_dmabuf.c * * Copyright (C) 2011 Texas Instruments * Author: Rob Clark @@ -53,10 +53,10 @@ static struct sg_table *omap_gem_map_dma_buf( /* this should be after _get_paddr() to ensure we have pages attached */ omap_gem_dma_sync(obj, dir); - return sg; out: - kfree(sg); - return ERR_PTR(ret); + if (ret) + return ERR_PTR(ret); + return sg; } static void omap_gem_unmap_dma_buf(struct dma_buf_attachment *attachment, diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_gem_helpers.c b/trunk/drivers/staging/omapdrm/omap_gem_helpers.c similarity index 98% rename from trunk/drivers/gpu/drm/omapdrm/omap_gem_helpers.c rename to trunk/drivers/staging/omapdrm/omap_gem_helpers.c index e4a66a35fc6a..ffb8cceaeb46 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_gem_helpers.c +++ b/trunk/drivers/staging/omapdrm/omap_gem_helpers.c @@ -1,5 +1,5 @@ /* - * drivers/gpu/drm/omapdrm/omap_gem_helpers.c + * drivers/staging/omapdrm/omap_gem_helpers.c * * Copyright (C) 2011 Texas Instruments * Author: Rob Clark diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_irq.c b/trunk/drivers/staging/omapdrm/omap_irq.c similarity index 99% rename from trunk/drivers/gpu/drm/omapdrm/omap_irq.c rename to trunk/drivers/staging/omapdrm/omap_irq.c index e01303ee00c3..2629ba7be6c8 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_irq.c +++ b/trunk/drivers/staging/omapdrm/omap_irq.c @@ -1,5 +1,5 @@ /* - * drivers/gpu/drm/omapdrm/omap_irq.c + * drivers/staging/omapdrm/omap_irq.c * * Copyright (C) 2012 Texas Instruments * Author: Rob Clark diff --git a/trunk/drivers/gpu/drm/omapdrm/omap_plane.c b/trunk/drivers/staging/omapdrm/omap_plane.c similarity index 99% rename from trunk/drivers/gpu/drm/omapdrm/omap_plane.c rename to trunk/drivers/staging/omapdrm/omap_plane.c index dd68d14ce615..bb989d7f026d 100644 --- a/trunk/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/trunk/drivers/staging/omapdrm/omap_plane.c @@ -1,5 +1,5 @@ /* - * drivers/gpu/drm/omapdrm/omap_plane.c + * drivers/staging/omapdrm/omap_plane.c * * Copyright (C) 2011 Texas Instruments * Author: Rob Clark diff --git a/trunk/drivers/gpu/drm/omapdrm/tcm-sita.c b/trunk/drivers/staging/omapdrm/tcm-sita.c similarity index 100% rename from trunk/drivers/gpu/drm/omapdrm/tcm-sita.c rename to trunk/drivers/staging/omapdrm/tcm-sita.c diff --git a/trunk/drivers/gpu/drm/omapdrm/tcm-sita.h b/trunk/drivers/staging/omapdrm/tcm-sita.h similarity index 100% rename from trunk/drivers/gpu/drm/omapdrm/tcm-sita.h rename to trunk/drivers/staging/omapdrm/tcm-sita.h diff --git a/trunk/drivers/gpu/drm/omapdrm/tcm.h b/trunk/drivers/staging/omapdrm/tcm.h similarity index 99% rename from trunk/drivers/gpu/drm/omapdrm/tcm.h rename to trunk/drivers/staging/omapdrm/tcm.h index a8d5ce47686f..d273e3ee0b4c 100644 --- a/trunk/drivers/gpu/drm/omapdrm/tcm.h +++ b/trunk/drivers/staging/omapdrm/tcm.h @@ -59,8 +59,6 @@ struct tcm { u16 width, height; /* container dimensions */ int lut_id; /* Lookup table identifier */ - unsigned int y_offset; /* offset to use for y coordinates */ - /* 'pvt' structure shall contain any tcm details (attr) along with linked list of allocated areas and mutex for mutually exclusive access to the list. It may also contain copies of width and height to notice diff --git a/trunk/include/drm/drm_crtc.h b/trunk/include/drm/drm_crtc.h index 8b7762728639..e90c8dcc028d 100644 --- a/trunk/include/drm/drm_crtc.h +++ b/trunk/include/drm/drm_crtc.h @@ -867,7 +867,6 @@ struct drm_prop_enum_list { extern void drm_modeset_lock_all(struct drm_device *dev); extern void drm_modeset_unlock_all(struct drm_device *dev); -extern void drm_warn_on_modeset_not_all_locked(struct drm_device *dev); extern int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, diff --git a/trunk/include/drm/drm_fb_helper.h b/trunk/include/drm/drm_fb_helper.h index c09511625a11..5120b01c2eeb 100644 --- a/trunk/include/drm/drm_fb_helper.h +++ b/trunk/include/drm/drm_fb_helper.h @@ -48,18 +48,6 @@ struct drm_fb_helper_surface_size { u32 surface_depth; }; -/** - * struct drm_fb_helper_funcs - driver callbacks for the fbdev emulation library - * @gamma_set: - Set the given gamma lut register on the given crtc. - * @gamma_get: - Read the given gamma lut register on the given crtc, used to - * save the current lut when force-restoring the fbdev for e.g. - * kdbg. - * @fb_probe: - Driver callback to allocate and initialize the fbdev info - * structure. Futhermore it also needs to allocate the drm - * framebuffer used to back the fbdev. - * - * Driver callbacks used by the fbdev emulation helper library. - */ struct drm_fb_helper_funcs { void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green, u16 blue, int regno); @@ -77,7 +65,9 @@ struct drm_fb_helper_connector { struct drm_fb_helper { struct drm_framebuffer *fb; + struct drm_framebuffer *saved_fb; struct drm_device *dev; + struct drm_display_mode *mode; int crtc_count; struct drm_fb_helper_crtc *crtc_info; int connector_count; @@ -92,6 +82,9 @@ struct drm_fb_helper { bool delayed_hotplug; }; +int drm_fb_helper_single_fb_probe(struct drm_fb_helper *helper, + int preferred_bpp); + int drm_fb_helper_init(struct drm_device *dev, struct drm_fb_helper *helper, int crtc_count, int max_conn); @@ -110,6 +103,7 @@ int drm_fb_helper_setcolreg(unsigned regno, struct fb_info *info); bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper); +void drm_fb_helper_restore(void); void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, uint32_t fb_width, uint32_t fb_height); void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,