[PATCH 1/7] drm: Add fb_helper->restore_fbdev_mode hook

2013-05-08 Thread Laurent Pinchart
Hi Ville,

Thank you for the patch.

On Wednesday 08 May 2013 12:55:16 ville.syrjala at linux.intel.com wrote:
> From: Ville Syrj?l? 
> 
> Drivers may need to turn off overlay planes, cursors, etc. when
> restoring the fbdev mode. So allow drivers to provide their own
> version of drm_fb_helper_restore_fbdev_mode() that can take care
> of such details.
> 
> Initially just plug in drm_fb_helper_restore_fbdev_mode for all
> drivers.
> 
> Signed-off-by: Ville Syrj?l? 
> ---
>  drivers/gpu/drm/ast/ast_fb.c  | 1 +
>  drivers/gpu/drm/cirrus/cirrus_fbdev.c | 1 +
>  drivers/gpu/drm/drm_fb_cma_helper.c   | 1 +
>  drivers/gpu/drm/drm_fb_helper.c   | 2 +-
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 1 +
>  drivers/gpu/drm/gma500/framebuffer.c  | 1 +
>  drivers/gpu/drm/i915/intel_fb.c   | 1 +
>  drivers/gpu/drm/mgag200/mgag200_fb.c  | 1 +
>  drivers/gpu/drm/nouveau/nouveau_fbcon.c   | 1 +
>  drivers/gpu/drm/omapdrm/omap_fbdev.c  | 1 +
>  drivers/gpu/drm/qxl/qxl_fb.c  | 1 +
>  drivers/gpu/drm/radeon/radeon_fb.c| 1 +
>  drivers/gpu/drm/udl/udl_fb.c  | 1 +
>  include/drm/drm_fb_helper.h   | 1 +
>  14 files changed, 14 insertions(+), 1 deletion(-)

[snip]

> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 8230b46..9f5b9be 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -72,6 +72,7 @@ struct drm_fb_helper_funcs {
>  struct drm_fb_helper_crtc **crtcs,
>  struct drm_display_mode **modes,
>  bool *enabled, int width, int height);
> + bool (*restore_fbdev_mode)(struct drm_fb_helper *fb_helper);

Could you please document this new function in the struct drm_fb_helper_funcs 
kerneldoc block ?

>  };
> 
>  struct drm_fb_helper_connector {
-- 
Regards,

Laurent Pinchart



[PATCH 1/7] drm: Add fb_helper->restore_fbdev_mode hook

2013-05-08 Thread ville.syrj...@linux.intel.com
From: Ville Syrj?l? 

Drivers may need to turn off overlay planes, cursors, etc. when
restoring the fbdev mode. So allow drivers to provide their own
version of drm_fb_helper_restore_fbdev_mode() that can take care
of such details.

Initially just plug in drm_fb_helper_restore_fbdev_mode for all
drivers.

Signed-off-by: Ville Syrj?l? 
---
 drivers/gpu/drm/ast/ast_fb.c  | 1 +
 drivers/gpu/drm/cirrus/cirrus_fbdev.c | 1 +
 drivers/gpu/drm/drm_fb_cma_helper.c   | 1 +
 drivers/gpu/drm/drm_fb_helper.c   | 2 +-
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 1 +
 drivers/gpu/drm/gma500/framebuffer.c  | 1 +
 drivers/gpu/drm/i915/intel_fb.c   | 1 +
 drivers/gpu/drm/mgag200/mgag200_fb.c  | 1 +
 drivers/gpu/drm/nouveau/nouveau_fbcon.c   | 1 +
 drivers/gpu/drm/omapdrm/omap_fbdev.c  | 1 +
 drivers/gpu/drm/qxl/qxl_fb.c  | 1 +
 drivers/gpu/drm/radeon/radeon_fb.c| 1 +
 drivers/gpu/drm/udl/udl_fb.c  | 1 +
 include/drm/drm_fb_helper.h   | 1 +
 14 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c
index 34931fe..2c1f469 100644
--- a/drivers/gpu/drm/ast/ast_fb.c
+++ b/drivers/gpu/drm/ast/ast_fb.c
@@ -254,6 +254,7 @@ 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,
+   .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
 };

 static void ast_fbdev_destroy(struct drm_device *dev,
diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c 
b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
index e25afcc..ee48a21 100644
--- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c
+++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
@@ -253,6 +253,7 @@ 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,
+   .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
 };

 int cirrus_fbdev_init(struct cirrus_device *cdev)
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c 
b/drivers/gpu/drm/drm_fb_cma_helper.c
index 0b5af7d..f011628 100644
--- a/drivers/gpu/drm/drm_fb_cma_helper.c
+++ b/drivers/gpu/drm/drm_fb_cma_helper.c
@@ -330,6 +330,7 @@ err_drm_gem_cma_free_object:

 static struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = {
.fb_probe = drm_fbdev_cma_create,
+   .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
 };

 /**
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index b78cbe7..02c70b2 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -315,7 +315,7 @@ static bool drm_fb_helper_force_kernel_mode(void)
if (helper->dev->switch_power_state == DRM_SWITCH_POWER_OFF)
continue;

-   ret = drm_fb_helper_restore_fbdev_mode(helper);
+   ret = helper->funcs->restore_fbdev_mode(helper);
if (ret)
error = true;
}
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c 
b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index 68f0045..6ed4065 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -228,6 +228,7 @@ out:

 static struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = {
.fb_probe = exynos_drm_fbdev_create,
+   .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
 };

 int exynos_drm_fbdev_init(struct drm_device *dev)
diff --git a/drivers/gpu/drm/gma500/framebuffer.c 
b/drivers/gpu/drm/gma500/framebuffer.c
index 1534e22..8d7f9c0 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -567,6 +567,7 @@ static struct drm_fb_helper_funcs psb_fb_helper_funcs = {
.gamma_set = psbfb_gamma_set,
.gamma_get = psbfb_gamma_get,
.fb_probe = psbfb_probe,
+   .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
 };

 static int psb_fbdev_destroy(struct drm_device *dev, struct psb_fbdev *fbdev)
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 0e19e57..a04481f 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -187,6 +187,7 @@ 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,
+   .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
 };

 static void intel_fbdev_destroy(struct drm_device *dev,
diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c 
b/drivers/gpu/drm/mgag200/mgag200_fb.c
index 421beab..23b8de2 100644
--- a/drivers/gpu/drm/mgag200/mgag200_fb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
@@ -239,6 +239,7 @@ static struct drm_fb_helper_funcs mga_fb_helper_funcs = {
.gamma_set = 

[PATCH 1/7] drm: Add fb_helper-restore_fbdev_mode hook

2013-05-08 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com

Drivers may need to turn off overlay planes, cursors, etc. when
restoring the fbdev mode. So allow drivers to provide their own
version of drm_fb_helper_restore_fbdev_mode() that can take care
of such details.

Initially just plug in drm_fb_helper_restore_fbdev_mode for all
drivers.

Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com
---
 drivers/gpu/drm/ast/ast_fb.c  | 1 +
 drivers/gpu/drm/cirrus/cirrus_fbdev.c | 1 +
 drivers/gpu/drm/drm_fb_cma_helper.c   | 1 +
 drivers/gpu/drm/drm_fb_helper.c   | 2 +-
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 1 +
 drivers/gpu/drm/gma500/framebuffer.c  | 1 +
 drivers/gpu/drm/i915/intel_fb.c   | 1 +
 drivers/gpu/drm/mgag200/mgag200_fb.c  | 1 +
 drivers/gpu/drm/nouveau/nouveau_fbcon.c   | 1 +
 drivers/gpu/drm/omapdrm/omap_fbdev.c  | 1 +
 drivers/gpu/drm/qxl/qxl_fb.c  | 1 +
 drivers/gpu/drm/radeon/radeon_fb.c| 1 +
 drivers/gpu/drm/udl/udl_fb.c  | 1 +
 include/drm/drm_fb_helper.h   | 1 +
 14 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c
index 34931fe..2c1f469 100644
--- a/drivers/gpu/drm/ast/ast_fb.c
+++ b/drivers/gpu/drm/ast/ast_fb.c
@@ -254,6 +254,7 @@ 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,
+   .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
 };
 
 static void ast_fbdev_destroy(struct drm_device *dev,
diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c 
b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
index e25afcc..ee48a21 100644
--- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c
+++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
@@ -253,6 +253,7 @@ 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,
+   .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
 };
 
 int cirrus_fbdev_init(struct cirrus_device *cdev)
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c 
b/drivers/gpu/drm/drm_fb_cma_helper.c
index 0b5af7d..f011628 100644
--- a/drivers/gpu/drm/drm_fb_cma_helper.c
+++ b/drivers/gpu/drm/drm_fb_cma_helper.c
@@ -330,6 +330,7 @@ err_drm_gem_cma_free_object:
 
 static struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = {
.fb_probe = drm_fbdev_cma_create,
+   .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
 };
 
 /**
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index b78cbe7..02c70b2 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -315,7 +315,7 @@ static bool drm_fb_helper_force_kernel_mode(void)
if (helper-dev-switch_power_state == DRM_SWITCH_POWER_OFF)
continue;
 
-   ret = drm_fb_helper_restore_fbdev_mode(helper);
+   ret = helper-funcs-restore_fbdev_mode(helper);
if (ret)
error = true;
}
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c 
b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index 68f0045..6ed4065 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -228,6 +228,7 @@ out:
 
 static struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = {
.fb_probe = exynos_drm_fbdev_create,
+   .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
 };
 
 int exynos_drm_fbdev_init(struct drm_device *dev)
diff --git a/drivers/gpu/drm/gma500/framebuffer.c 
b/drivers/gpu/drm/gma500/framebuffer.c
index 1534e22..8d7f9c0 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -567,6 +567,7 @@ static struct drm_fb_helper_funcs psb_fb_helper_funcs = {
.gamma_set = psbfb_gamma_set,
.gamma_get = psbfb_gamma_get,
.fb_probe = psbfb_probe,
+   .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
 };
 
 static int psb_fbdev_destroy(struct drm_device *dev, struct psb_fbdev *fbdev)
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 0e19e57..a04481f 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -187,6 +187,7 @@ 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,
+   .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode,
 };
 
 static void intel_fbdev_destroy(struct drm_device *dev,
diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c 
b/drivers/gpu/drm/mgag200/mgag200_fb.c
index 421beab..23b8de2 100644
--- a/drivers/gpu/drm/mgag200/mgag200_fb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
@@ -239,6 +239,7 @@ static struct drm_fb_helper_funcs mga_fb_helper_funcs 

Re: [PATCH 1/7] drm: Add fb_helper-restore_fbdev_mode hook

2013-05-08 Thread Laurent Pinchart
Hi Ville,

Thank you for the patch.

On Wednesday 08 May 2013 12:55:16 ville.syrj...@linux.intel.com wrote:
 From: Ville Syrjälä ville.syrj...@linux.intel.com
 
 Drivers may need to turn off overlay planes, cursors, etc. when
 restoring the fbdev mode. So allow drivers to provide their own
 version of drm_fb_helper_restore_fbdev_mode() that can take care
 of such details.
 
 Initially just plug in drm_fb_helper_restore_fbdev_mode for all
 drivers.
 
 Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com
 ---
  drivers/gpu/drm/ast/ast_fb.c  | 1 +
  drivers/gpu/drm/cirrus/cirrus_fbdev.c | 1 +
  drivers/gpu/drm/drm_fb_cma_helper.c   | 1 +
  drivers/gpu/drm/drm_fb_helper.c   | 2 +-
  drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 1 +
  drivers/gpu/drm/gma500/framebuffer.c  | 1 +
  drivers/gpu/drm/i915/intel_fb.c   | 1 +
  drivers/gpu/drm/mgag200/mgag200_fb.c  | 1 +
  drivers/gpu/drm/nouveau/nouveau_fbcon.c   | 1 +
  drivers/gpu/drm/omapdrm/omap_fbdev.c  | 1 +
  drivers/gpu/drm/qxl/qxl_fb.c  | 1 +
  drivers/gpu/drm/radeon/radeon_fb.c| 1 +
  drivers/gpu/drm/udl/udl_fb.c  | 1 +
  include/drm/drm_fb_helper.h   | 1 +
  14 files changed, 14 insertions(+), 1 deletion(-)

[snip]

 diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
 index 8230b46..9f5b9be 100644
 --- a/include/drm/drm_fb_helper.h
 +++ b/include/drm/drm_fb_helper.h
 @@ -72,6 +72,7 @@ struct drm_fb_helper_funcs {
  struct drm_fb_helper_crtc **crtcs,
  struct drm_display_mode **modes,
  bool *enabled, int width, int height);
 + bool (*restore_fbdev_mode)(struct drm_fb_helper *fb_helper);

Could you please document this new function in the struct drm_fb_helper_funcs 
kerneldoc block ?

  };
 
  struct drm_fb_helper_connector {
-- 
Regards,

Laurent Pinchart

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel