* [PATCH 1/2] drm/i915: Report the origin of the LVDS fixed panel mode
@ 2012-11-21 16:14 Chris Wilson
2012-11-21 16:14 ` [PATCH 2/2] drm/i915: LVDS fallback to fixed-mode if EDID not present Chris Wilson
2012-11-22 16:10 ` [PATCH 1/2] drm/i915: Report the origin of the LVDS fixed panel mode Jani Nikula
0 siblings, 2 replies; 6+ messages in thread
From: Chris Wilson @ 2012-11-21 16:14 UTC (permalink / raw)
To: intel-gfx
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/intel_lvds.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 860fa71..5b38c17 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -1083,6 +1083,9 @@ bool intel_lvds_init(struct drm_device *dev)
list_for_each_entry(scan, &connector->probed_modes, head) {
if (scan->type & DRM_MODE_TYPE_PREFERRED) {
+ DRM_DEBUG_KMS("using preferred mode from EDID: ");
+ drm_mode_debug_printmodeline(scan);
+
fixed_mode = drm_mode_duplicate(dev, scan);
intel_find_lvds_downclock(dev, fixed_mode, connector);
goto out;
@@ -1091,6 +1094,9 @@ bool intel_lvds_init(struct drm_device *dev)
/* Failed to get EDID, what about VBT? */
if (dev_priv->lfp_lvds_vbt_mode) {
+ DRM_DEBUG_KMS("using mode from VBT: ");
+ drm_mode_debug_printmodeline(dev_priv->lfp_lvds_vbt_mode);
+
fixed_mode = drm_mode_duplicate(dev, dev_priv->lfp_lvds_vbt_mode);
if (fixed_mode) {
fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
@@ -1115,8 +1121,11 @@ bool intel_lvds_init(struct drm_device *dev)
if (crtc && (lvds & LVDS_PORT_EN)) {
struct drm_display_mode mode;
- if (intel_crtc_get_mode(crtc, &mode))
+ if (intel_crtc_get_mode(crtc, &mode)) {
+ DRM_DEBUG_KMS("using current (BIOS) mode: ");
+ drm_mode_debug_printmodeline(&mode);
fixed_mode = drm_mode_duplicate(dev, &mode);
+ }
if (fixed_mode) {
fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
fixed_mode->flags = intel_lvds_get_mode_flags(intel_encoder);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] drm/i915: LVDS fallback to fixed-mode if EDID not present
2012-11-21 16:14 [PATCH 1/2] drm/i915: Report the origin of the LVDS fixed panel mode Chris Wilson
@ 2012-11-21 16:14 ` Chris Wilson
2012-11-22 16:20 ` Jani Nikula
2012-11-22 16:10 ` [PATCH 1/2] drm/i915: Report the origin of the LVDS fixed panel mode Jani Nikula
1 sibling, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2012-11-21 16:14 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula
Use the recorded panel fixed-mode to populate the get_modes() request in
the absence of an EDID.
Fixes regression from
commit 9cd300e038d492af4990b04e127e0bd2df64b1ca
Author: Jani Nikula <jani.nikula@intel.com>
Date: Fri Oct 19 14:51:52 2012 +0300
drm/i915: Move cached EDID to intel_connector
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
---
drivers/gpu/drm/i915/intel_lvds.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 5b38c17..189390e 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -480,13 +480,8 @@ static int intel_lvds_get_modes(struct drm_connector *connector)
struct drm_display_mode *mode;
/* use cached edid if we have one */
- if (lvds_connector->base.edid) {
- /* invalid edid */
- if (IS_ERR(lvds_connector->base.edid))
- return 0;
-
+ if (!IS_ERR_OR_NULL(lvds_connector->base.edid))
return drm_add_edid_modes(connector, lvds_connector->base.edid);
- }
mode = drm_mode_duplicate(dev, lvds_connector->base.panel.fixed_mode);
if (mode == NULL)
@@ -1065,8 +1060,6 @@ bool intel_lvds_init(struct drm_device *dev)
kfree(edid);
edid = ERR_PTR(-EINVAL);
}
- } else {
- edid = ERR_PTR(-ENOENT);
}
lvds_connector->base.edid = edid;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] drm/i915: Report the origin of the LVDS fixed panel mode
2012-11-21 16:14 [PATCH 1/2] drm/i915: Report the origin of the LVDS fixed panel mode Chris Wilson
2012-11-21 16:14 ` [PATCH 2/2] drm/i915: LVDS fallback to fixed-mode if EDID not present Chris Wilson
@ 2012-11-22 16:10 ` Jani Nikula
2012-11-25 19:00 ` Daniel Vetter
1 sibling, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2012-11-22 16:10 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
On Wed, 21 Nov 2012, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/intel_lvds.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> index 860fa71..5b38c17 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -1083,6 +1083,9 @@ bool intel_lvds_init(struct drm_device *dev)
>
> list_for_each_entry(scan, &connector->probed_modes, head) {
> if (scan->type & DRM_MODE_TYPE_PREFERRED) {
> + DRM_DEBUG_KMS("using preferred mode from EDID: ");
> + drm_mode_debug_printmodeline(scan);
> +
> fixed_mode = drm_mode_duplicate(dev, scan);
> intel_find_lvds_downclock(dev, fixed_mode, connector);
> goto out;
> @@ -1091,6 +1094,9 @@ bool intel_lvds_init(struct drm_device *dev)
>
> /* Failed to get EDID, what about VBT? */
> if (dev_priv->lfp_lvds_vbt_mode) {
> + DRM_DEBUG_KMS("using mode from VBT: ");
> + drm_mode_debug_printmodeline(dev_priv->lfp_lvds_vbt_mode);
> +
> fixed_mode = drm_mode_duplicate(dev, dev_priv->lfp_lvds_vbt_mode);
> if (fixed_mode) {
> fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
> @@ -1115,8 +1121,11 @@ bool intel_lvds_init(struct drm_device *dev)
> if (crtc && (lvds & LVDS_PORT_EN)) {
> struct drm_display_mode mode;
>
> - if (intel_crtc_get_mode(crtc, &mode))
> + if (intel_crtc_get_mode(crtc, &mode)) {
> + DRM_DEBUG_KMS("using current (BIOS) mode: ");
> + drm_mode_debug_printmodeline(&mode);
> fixed_mode = drm_mode_duplicate(dev, &mode);
> + }
> if (fixed_mode) {
> fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
> fixed_mode->flags = intel_lvds_get_mode_flags(intel_encoder);
> --
> 1.7.10.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] drm/i915: LVDS fallback to fixed-mode if EDID not present
2012-11-21 16:14 ` [PATCH 2/2] drm/i915: LVDS fallback to fixed-mode if EDID not present Chris Wilson
@ 2012-11-22 16:20 ` Jani Nikula
2012-11-22 16:36 ` Chris Wilson
0 siblings, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2012-11-22 16:20 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
On Wed, 21 Nov 2012, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Use the recorded panel fixed-mode to populate the get_modes() request in
> the absence of an EDID.
>
> Fixes regression from
> commit 9cd300e038d492af4990b04e127e0bd2df64b1ca
> Author: Jani Nikula <jani.nikula@intel.com>
> Date: Fri Oct 19 14:51:52 2012 +0300
>
> drm/i915: Move cached EDID to intel_connector
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
> drivers/gpu/drm/i915/intel_lvds.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> index 5b38c17..189390e 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -480,13 +480,8 @@ static int intel_lvds_get_modes(struct drm_connector *connector)
> struct drm_display_mode *mode;
>
> /* use cached edid if we have one */
> - if (lvds_connector->base.edid) {
> - /* invalid edid */
> - if (IS_ERR(lvds_connector->base.edid))
> - return 0;
> -
> + if (!IS_ERR_OR_NULL(lvds_connector->base.edid))
> return drm_add_edid_modes(connector, lvds_connector->base.edid);
> - }
Yeah, good catch, my bad. I guess I was pressing too hard to have
similar code in DP and LVDS...
>
> mode = drm_mode_duplicate(dev, lvds_connector->base.panel.fixed_mode);
> if (mode == NULL)
> @@ -1065,8 +1060,6 @@ bool intel_lvds_init(struct drm_device *dev)
> kfree(edid);
> edid = ERR_PTR(-EINVAL);
> }
> - } else {
> - edid = ERR_PTR(-ENOENT);
I'd like to keep this though. I was thinking a more generic, future EDID
caching feature might use the difference between -EINVAL and -ENOENT,
NULL being the "we just haven't read it yet" flag, to prevent trying to
re-read the EDID when it isn't there. *shrug*. Either way,
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> }
> lvds_connector->base.edid = edid;
>
> --
> 1.7.10.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] drm/i915: LVDS fallback to fixed-mode if EDID not present
2012-11-22 16:20 ` Jani Nikula
@ 2012-11-22 16:36 ` Chris Wilson
0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2012-11-22 16:36 UTC (permalink / raw)
To: Jani Nikula, intel-gfx
On Thu, 22 Nov 2012 18:20:27 +0200, Jani Nikula <jani.nikula@intel.com> wrote:
> On Wed, 21 Nov 2012, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> >
> > mode = drm_mode_duplicate(dev, lvds_connector->base.panel.fixed_mode);
> > if (mode == NULL)
> > @@ -1065,8 +1060,6 @@ bool intel_lvds_init(struct drm_device *dev)
> > kfree(edid);
> > edid = ERR_PTR(-EINVAL);
> > }
> > - } else {
> > - edid = ERR_PTR(-ENOENT);
>
> I'd like to keep this though. I was thinking a more generic, future EDID
> caching feature might use the difference between -EINVAL and -ENOENT,
> NULL being the "we just haven't read it yet" flag, to prevent trying to
> re-read the EDID when it isn't there. *shrug*.
Okay, that's a reasonable argument. Daniel feel free to drop this hunk.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] drm/i915: Report the origin of the LVDS fixed panel mode
2012-11-22 16:10 ` [PATCH 1/2] drm/i915: Report the origin of the LVDS fixed panel mode Jani Nikula
@ 2012-11-25 19:00 ` Daniel Vetter
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2012-11-25 19:00 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Thu, Nov 22, 2012 at 06:10:07PM +0200, Jani Nikula wrote:
>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>
>
> On Wed, 21 Nov 2012, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Forgot to mention: Both now merged to dinq, thanks for the patches.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-11-25 18:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-21 16:14 [PATCH 1/2] drm/i915: Report the origin of the LVDS fixed panel mode Chris Wilson
2012-11-21 16:14 ` [PATCH 2/2] drm/i915: LVDS fallback to fixed-mode if EDID not present Chris Wilson
2012-11-22 16:20 ` Jani Nikula
2012-11-22 16:36 ` Chris Wilson
2012-11-22 16:10 ` [PATCH 1/2] drm/i915: Report the origin of the LVDS fixed panel mode Jani Nikula
2012-11-25 19:00 ` Daniel Vetter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.