* [PATCH 1/3] drm/i915/lvds: move fitting mode from intel_lvds_connector to intel_panel
2012-10-26 9:03 ` [PATCH 0/3] drm/i915: eDP scaling mode change support Jani Nikula
@ 2012-10-26 9:03 ` Jani Nikula
2012-10-26 9:04 ` [PATCH 2/3] drm/i915/dp: allow configuring eDP panel fitting scaling mode Jani Nikula
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2012-10-26 9:03 UTC (permalink / raw)
To: Yuly Novikov, Daniel Vetter; +Cc: airlied, jani.nikula, intel-gfx, dri-devel
Prepare for supporting scaling mode configuration also in eDP.
Includes a drive-by-removal of an outdated comment about fitting mode.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/intel_drv.h | 1 +
drivers/gpu/drm/i915/intel_lvds.c | 24 ++++++++++--------------
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 81d2020..8839ed5 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -165,6 +165,7 @@ struct intel_encoder {
struct intel_panel {
struct drm_display_mode *fixed_mode;
+ int fitting_mode;
};
struct intel_connector {
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 587ed0f..ffa0051 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -44,7 +44,6 @@ struct intel_lvds_connector {
struct intel_connector base;
struct notifier_block lid_notifier;
- int fitting_mode;
};
struct intel_lvds_encoder {
@@ -253,8 +252,8 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder,
struct drm_device *dev = encoder->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder);
- struct intel_lvds_connector *lvds_connector =
- lvds_encoder->attached_connector;
+ struct intel_connector *intel_connector =
+ &lvds_encoder->attached_connector->base;
struct intel_crtc *intel_crtc = lvds_encoder->base.new_crtc;
u32 pfit_control = 0, pfit_pgm_ratios = 0, border = 0;
int pipe;
@@ -274,11 +273,12 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder,
* with the panel scaling set up to source from the H/VDisplay
* of the original mode.
*/
- intel_fixed_panel_mode(lvds_connector->base.panel.fixed_mode,
+ intel_fixed_panel_mode(intel_connector->panel.fixed_mode,
adjusted_mode);
if (HAS_PCH_SPLIT(dev)) {
- intel_pch_panel_fitting(dev, lvds_connector->fitting_mode,
+ intel_pch_panel_fitting(dev,
+ intel_connector->panel.fitting_mode,
mode, adjusted_mode);
return true;
}
@@ -304,7 +304,7 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder,
drm_mode_set_crtcinfo(adjusted_mode, 0);
- switch (lvds_connector->fitting_mode) {
+ switch (intel_connector->panel.fitting_mode) {
case DRM_MODE_SCALE_CENTER:
/*
* For centered modes, we have to calculate border widths &
@@ -573,7 +573,7 @@ static int intel_lvds_set_property(struct drm_connector *connector,
struct drm_property *property,
uint64_t value)
{
- struct intel_lvds_connector *lvds_connector = to_lvds_connector(connector);
+ struct intel_connector *intel_connector = to_intel_connector(connector);
struct drm_device *dev = connector->dev;
if (property == dev->mode_config.scaling_mode_property) {
@@ -584,11 +584,11 @@ static int intel_lvds_set_property(struct drm_connector *connector,
return -EINVAL;
}
- if (lvds_connector->fitting_mode == value) {
+ if (intel_connector->panel.fitting_mode == value) {
/* the LVDS scaling property is not changed */
return 0;
}
- lvds_connector->fitting_mode = value;
+ intel_connector->panel.fitting_mode = value;
crtc = intel_attached_encoder(connector)->base.crtc;
if (crtc && crtc->enabled) {
@@ -1008,14 +1008,10 @@ bool intel_lvds_init(struct drm_device *dev)
/* create the scaling mode property */
drm_mode_create_scaling_mode_property(dev);
- /*
- * the initial panel fitting mode will be FULL_SCREEN.
- */
-
drm_connector_attach_property(&intel_connector->base,
dev->mode_config.scaling_mode_property,
DRM_MODE_SCALE_ASPECT);
- lvds_connector->fitting_mode = DRM_MODE_SCALE_ASPECT;
+ intel_connector->panel.fitting_mode = DRM_MODE_SCALE_ASPECT;
/*
* LVDS discovery:
* 1) check for EDID on DDC
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] drm/i915/dp: allow configuring eDP panel fitting scaling mode
2012-10-26 9:03 ` [PATCH 0/3] drm/i915: eDP scaling mode change support Jani Nikula
2012-10-26 9:03 ` [PATCH 1/3] drm/i915/lvds: move fitting mode from intel_lvds_connector to intel_panel Jani Nikula
@ 2012-10-26 9:04 ` Jani Nikula
2012-10-26 9:04 ` [PATCH 3/3] drm/i915/dp: change eDP default scaling mode to respect aspect ratio Jani Nikula
2012-10-26 13:44 ` [Intel-gfx] [PATCH 0/3] drm/i915: eDP scaling mode change support Paulo Zanoni
3 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2012-10-26 9:04 UTC (permalink / raw)
To: Yuly Novikov, Daniel Vetter; +Cc: airlied, jani.nikula, intel-gfx, dri-devel
From: Yuly Novikov <ynovikov@chromium.org>
LVDS allowed changing panel fitting scaling mode, while eDP didn't. Copied
relevant code from LVDS to eDP.
Signed-off-by: Yuly Novikov <ynovikov@chromium.org>
[Jani: use fitting mode in intel_panel, remove default mode change]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 2a9998a..30314c0 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -693,7 +693,8 @@ intel_dp_mode_fixup(struct drm_encoder *encoder,
if (is_edp(intel_dp) && intel_connector->panel.fixed_mode) {
intel_fixed_panel_mode(intel_connector->panel.fixed_mode,
adjusted_mode);
- intel_pch_panel_fitting(dev, DRM_MODE_SCALE_FULLSCREEN,
+ intel_pch_panel_fitting(dev,
+ intel_connector->panel.fitting_mode,
mode, adjusted_mode);
}
@@ -2359,6 +2360,7 @@ intel_dp_set_property(struct drm_connector *connector,
uint64_t val)
{
struct drm_i915_private *dev_priv = connector->dev->dev_private;
+ struct intel_connector *intel_connector = to_intel_connector(connector);
struct intel_dp *intel_dp = intel_attached_dp(connector);
int ret;
@@ -2395,6 +2397,22 @@ intel_dp_set_property(struct drm_connector *connector,
goto done;
}
+ if (is_edp(intel_dp) &&
+ property == connector->dev->mode_config.scaling_mode_property) {
+ if (val == DRM_MODE_SCALE_NONE) {
+ DRM_DEBUG_KMS("no scaling not supported\n");
+ return -EINVAL;
+ }
+
+ if (intel_connector->panel.fitting_mode == val) {
+ /* the eDP scaling property is not changed */
+ return 0;
+ }
+ intel_connector->panel.fitting_mode = val;
+
+ goto done;
+ }
+
return -EINVAL;
done:
@@ -2519,8 +2537,19 @@ bool intel_dpd_is_edp(struct drm_device *dev)
static void
intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connector)
{
+ struct intel_connector *intel_connector = to_intel_connector(connector);
+
intel_attach_force_audio_property(connector);
intel_attach_broadcast_rgb_property(connector);
+
+ if (is_edp(intel_dp)) {
+ drm_mode_create_scaling_mode_property(connector->dev);
+ drm_connector_attach_property(
+ connector,
+ connector->dev->mode_config.scaling_mode_property,
+ DRM_MODE_SCALE_FULLSCREEN);
+ intel_connector->panel.fitting_mode = DRM_MODE_SCALE_FULLSCREEN;
+ }
}
static void
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] drm/i915/dp: change eDP default scaling mode to respect aspect ratio
2012-10-26 9:03 ` [PATCH 0/3] drm/i915: eDP scaling mode change support Jani Nikula
2012-10-26 9:03 ` [PATCH 1/3] drm/i915/lvds: move fitting mode from intel_lvds_connector to intel_panel Jani Nikula
2012-10-26 9:04 ` [PATCH 2/3] drm/i915/dp: allow configuring eDP panel fitting scaling mode Jani Nikula
@ 2012-10-26 9:04 ` Jani Nikula
2012-10-26 13:44 ` [Intel-gfx] [PATCH 0/3] drm/i915: eDP scaling mode change support Paulo Zanoni
3 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2012-10-26 9:04 UTC (permalink / raw)
To: Yuly Novikov, Daniel Vetter; +Cc: airlied, jani.nikula, intel-gfx, dri-devel
From: Yuly Novikov <ynovikov@chromium.org>
Signed-off-by: Yuly Novikov <ynovikov@chromium.org>
[Jani: ripped this change separate from the scaling mode change support]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 30314c0..a1b9fc13 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2547,8 +2547,8 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect
drm_connector_attach_property(
connector,
connector->dev->mode_config.scaling_mode_property,
- DRM_MODE_SCALE_FULLSCREEN);
- intel_connector->panel.fitting_mode = DRM_MODE_SCALE_FULLSCREEN;
+ DRM_MODE_SCALE_ASPECT);
+ intel_connector->panel.fitting_mode = DRM_MODE_SCALE_ASPECT;
}
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Intel-gfx] [PATCH 0/3] drm/i915: eDP scaling mode change support
2012-10-26 9:03 ` [PATCH 0/3] drm/i915: eDP scaling mode change support Jani Nikula
` (2 preceding siblings ...)
2012-10-26 9:04 ` [PATCH 3/3] drm/i915/dp: change eDP default scaling mode to respect aspect ratio Jani Nikula
@ 2012-10-26 13:44 ` Paulo Zanoni
2012-11-03 0:16 ` Yuly Novikov
3 siblings, 1 reply; 8+ messages in thread
From: Paulo Zanoni @ 2012-10-26 13:44 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx, dri-devel, Yuly Novikov
Hi
2012/10/26 Jani Nikula <jani.nikula@intel.com>:
> [Dropped lkml, added intel-gfx]
>
> Hi Yuly, here's a slightly modified version of your patch, rebased on
> drm-intel-next-queued. I kept your authorship, but any new errors are
> totally mine...
>
> These are compile tested only; I'd appreciate if you could check it
> still does what it says on the box!
I have nothing to add or remove. Tested on HSW eDP, used "xrandr" to
alternate the property values. Works fine.
Being consistent on the default value between LVDS and eDP is
certainly a nice thing.
For the 3 patches:
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> BR,
> Jani.
>
>
> Jani Nikula (1):
> drm/i915/lvds: move fitting mode from intel_lvds_connector to
> intel_panel
>
> Yuly Novikov (2):
> drm/i915/dp: allow configuring eDP panel fitting scaling mode
> drm/i915/dp: change eDP default scaling mode to respect aspect ratio
>
> drivers/gpu/drm/i915/intel_dp.c | 31 ++++++++++++++++++++++++++++++-
> drivers/gpu/drm/i915/intel_drv.h | 1 +
> drivers/gpu/drm/i915/intel_lvds.c | 24 ++++++++++--------------
> 3 files changed, 41 insertions(+), 15 deletions(-)
>
> --
> 1.7.9.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Paulo Zanoni
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Intel-gfx] [PATCH 0/3] drm/i915: eDP scaling mode change support
2012-10-26 13:44 ` [Intel-gfx] [PATCH 0/3] drm/i915: eDP scaling mode change support Paulo Zanoni
@ 2012-11-03 0:16 ` Yuly Novikov
0 siblings, 0 replies; 8+ messages in thread
From: Yuly Novikov @ 2012-11-03 0:16 UTC (permalink / raw)
To: Jani Nikula; +Cc: dri-devel, intel-gfx
[-- Attachment #1.1: Type: text/plain, Size: 1838 bytes --]
Hi Jani,
Sorry for the delay, our branches have diverged significantly, and it took
me quite a while to merge your changes.
On the bright sight, I've tested the patch on SandyBridge LDVS and
IvyBridge eDP, and it works fine.
Regards,
Yuly.
On Fri, Oct 26, 2012 at 9:44 AM, Paulo Zanoni <przanoni@gmail.com> wrote:
> Hi
>
> 2012/10/26 Jani Nikula <jani.nikula@intel.com>:
> > [Dropped lkml, added intel-gfx]
> >
> > Hi Yuly, here's a slightly modified version of your patch, rebased on
> > drm-intel-next-queued. I kept your authorship, but any new errors are
> > totally mine...
> >
> > These are compile tested only; I'd appreciate if you could check it
> > still does what it says on the box!
>
> I have nothing to add or remove. Tested on HSW eDP, used "xrandr" to
> alternate the property values. Works fine.
>
> Being consistent on the default value between LVDS and eDP is
> certainly a nice thing.
>
> For the 3 patches:
> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> >
> > BR,
> > Jani.
> >
> >
> > Jani Nikula (1):
> > drm/i915/lvds: move fitting mode from intel_lvds_connector to
> > intel_panel
> >
> > Yuly Novikov (2):
> > drm/i915/dp: allow configuring eDP panel fitting scaling mode
> > drm/i915/dp: change eDP default scaling mode to respect aspect ratio
> >
> > drivers/gpu/drm/i915/intel_dp.c | 31 ++++++++++++++++++++++++++++++-
> > drivers/gpu/drm/i915/intel_drv.h | 1 +
> > drivers/gpu/drm/i915/intel_lvds.c | 24 ++++++++++--------------
> > 3 files changed, 41 insertions(+), 15 deletions(-)
> >
> > --
> > 1.7.9.5
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
>
>
> --
> Paulo Zanoni
>
[-- Attachment #1.2: Type: text/html, Size: 2939 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread