Re: [Intel-gfx] [PATCH 2/6] drm/i915: Don't use intel_crtc-new_config in pll calculation code

2015-04-07 Thread Daniel Vetter
On Thu, Apr 02, 2015 at 02:47:57PM +0300, Ander Conselvan de Oliveira wrote:
 Move towards atomic by using the atomic state instead.
 
 Signed-off-by: Ander Conselvan de Oliveira 
 ander.conselvan.de.olive...@intel.com
 ---
  drivers/gpu/drm/i915/intel_display.c | 15 +++
  1 file changed, 11 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/gpu/drm/i915/intel_display.c 
 b/drivers/gpu/drm/i915/intel_display.c
 index a6cd8c7..0b7ddee 100644
 --- a/drivers/gpu/drm/i915/intel_display.c
 +++ b/drivers/gpu/drm/i915/intel_display.c
 @@ -11581,10 +11581,11 @@ intel_modeset_compute_config(struct drm_crtc *crtc,
   return intel_atomic_get_crtc_state(state, to_intel_crtc(crtc));;
  }
  
 -static int __intel_set_mode_setup_plls(struct drm_device *dev,
 +static int __intel_set_mode_setup_plls(struct drm_atomic_state *state,
  unsigned modeset_pipes,
  unsigned disable_pipes)

Bikeshed: The name of this function is a bit confusion - it's part of the
compute_config phase of modesets still, but not really named like that.
Same with the call to valleyview_modeset_global_pipes right above it.

The problem is also that this is separated from the other compute_config
code. Hence I think we can only apply some polish here once that's all
unified again and merged into the overall atomic_check function.
-Daniel

  {
 + struct drm_device *dev = state-dev;
   struct drm_i915_private *dev_priv = to_i915(dev);
   unsigned clear_pipes = modeset_pipes | disable_pipes;
   struct intel_crtc *intel_crtc;
 @@ -11598,9 +11599,15 @@ static int __intel_set_mode_setup_plls(struct 
 drm_device *dev,
   goto done;
  
   for_each_intel_crtc_masked(dev, modeset_pipes, intel_crtc) {
 - struct intel_crtc_state *state = intel_crtc-new_config;
 + struct intel_crtc_state *crtc_state =
 + intel_atomic_get_crtc_state(state, intel_crtc);
 +
 + /* Modeset pipes should have a new state by now */
 + if (WARN_ON(IS_ERR(crtc_state)))
 + continue;
 +
   ret = dev_priv-display.crtc_compute_clock(intel_crtc,
 -state);
 +crtc_state);
   if (ret) {
   intel_shared_dpll_abort_config(dev_priv);
   goto done;
 @@ -11658,7 +11665,7 @@ static int __intel_set_mode(struct drm_crtc *crtc,
   prepare_pipes = ~disable_pipes;
   }
  
 - ret = __intel_set_mode_setup_plls(dev, modeset_pipes, disable_pipes);
 + ret = __intel_set_mode_setup_plls(state, modeset_pipes, disable_pipes);
   if (ret)
   goto done;
  
 -- 
 2.1.0
 
 ___
 Intel-gfx mailing list
 Intel-gfx@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 2/6] drm/i915: Don't use intel_crtc-new_config in pll calculation code

2015-04-02 Thread Ander Conselvan de Oliveira
Move towards atomic by using the atomic state instead.

Signed-off-by: Ander Conselvan de Oliveira 
ander.conselvan.de.olive...@intel.com
---
 drivers/gpu/drm/i915/intel_display.c | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index a6cd8c7..0b7ddee 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11581,10 +11581,11 @@ intel_modeset_compute_config(struct drm_crtc *crtc,
return intel_atomic_get_crtc_state(state, to_intel_crtc(crtc));;
 }
 
-static int __intel_set_mode_setup_plls(struct drm_device *dev,
+static int __intel_set_mode_setup_plls(struct drm_atomic_state *state,
   unsigned modeset_pipes,
   unsigned disable_pipes)
 {
+   struct drm_device *dev = state-dev;
struct drm_i915_private *dev_priv = to_i915(dev);
unsigned clear_pipes = modeset_pipes | disable_pipes;
struct intel_crtc *intel_crtc;
@@ -11598,9 +11599,15 @@ static int __intel_set_mode_setup_plls(struct 
drm_device *dev,
goto done;
 
for_each_intel_crtc_masked(dev, modeset_pipes, intel_crtc) {
-   struct intel_crtc_state *state = intel_crtc-new_config;
+   struct intel_crtc_state *crtc_state =
+   intel_atomic_get_crtc_state(state, intel_crtc);
+
+   /* Modeset pipes should have a new state by now */
+   if (WARN_ON(IS_ERR(crtc_state)))
+   continue;
+
ret = dev_priv-display.crtc_compute_clock(intel_crtc,
-  state);
+  crtc_state);
if (ret) {
intel_shared_dpll_abort_config(dev_priv);
goto done;
@@ -11658,7 +11665,7 @@ static int __intel_set_mode(struct drm_crtc *crtc,
prepare_pipes = ~disable_pipes;
}
 
-   ret = __intel_set_mode_setup_plls(dev, modeset_pipes, disable_pipes);
+   ret = __intel_set_mode_setup_plls(state, modeset_pipes, disable_pipes);
if (ret)
goto done;
 
-- 
2.1.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx