Message ID | 5723d9006de706582fb46f9e1e3eb8ce168c2126.1567492316.git.baolin.wang@linaro.org |
---|---|
State | New |
Headers | show |
Series | [BACKPORT,4.14.y,1/8] drm/i915/fbdev: Actually configure untiled displays | expand |
On Thu, 5 Sep 2019 at 01:25, Greg KH <greg@kroah.com> wrote: > > On Tue, Sep 03, 2019 at 02:55:26PM +0800, Baolin Wang wrote: > > From: Chris Wilson <chris@chris-wilson.co.uk> > > > > If we skipped all the connectors that were not part of a tile, we would > > leave conn_seq=0 and conn_configured=0, convincing ourselves that we > > had stagnated in our configuration attempts. Avoid this situation by > > starting conn_seq=ALL_CONNECTORS, and repeating until we find no more > > connectors to configure. > > > > Fixes: 754a76591b12 ("drm/i915/fbdev: Stop repeating tile configuration on stagnation") > > Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> > > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > > Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > > Link: https://patchwork.freedesktop.org/patch/msgid/20190215123019.32283-1-chris@chris-wilson.co.uk > > Cc: <stable@vger.kernel.org> # v3.19+ > > Signed-off-by: Baolin Wang <baolin.wang@linaro.org> > > --- > > drivers/gpu/drm/i915/intel_fbdev.c | 12 +++++++----- > > 1 file changed, 7 insertions(+), 5 deletions(-) > > What is the git commit id of this patch in Linus's tree? The commit id is: d9b308b1f8a1acc0c3279f443d4fe0f9f663252e > > Can you please add that as the first line of the changelog like is done > with all other stable patches? That way I can verify that what you > posted here is the correct one. > > Please fix the up for all of these and resend. Sure. Thanks. -- Baolin Wang Best Regards
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c index da2d309..14eb8a0 100644 --- a/drivers/gpu/drm/i915/intel_fbdev.c +++ b/drivers/gpu/drm/i915/intel_fbdev.c @@ -326,8 +326,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, bool *enabled, int width, int height) { struct drm_i915_private *dev_priv = to_i915(fb_helper->dev); - unsigned long conn_configured, conn_seq, mask; unsigned int count = min(fb_helper->connector_count, BITS_PER_LONG); + unsigned long conn_configured, conn_seq; int i, j; bool *save_enabled; bool fallback = true, ret = true; @@ -345,10 +345,9 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, drm_modeset_backoff(&ctx); memcpy(save_enabled, enabled, count); - mask = GENMASK(count - 1, 0); + conn_seq = GENMASK(count - 1, 0); conn_configured = 0; retry: - conn_seq = conn_configured; for (i = 0; i < count; i++) { struct drm_fb_helper_connector *fb_conn; struct drm_connector *connector; @@ -361,7 +360,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, if (conn_configured & BIT(i)) continue; - if (conn_seq == 0 && !connector->has_tile) + /* First pass, only consider tiled connectors */ + if (conn_seq == GENMASK(count - 1, 0) && !connector->has_tile) continue; if (connector->status == connector_status_connected) @@ -465,8 +465,10 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, conn_configured |= BIT(i); } - if ((conn_configured & mask) != mask && conn_configured != conn_seq) + if (conn_configured != conn_seq) { /* repeat until no more are found */ + conn_seq = conn_configured; goto retry; + } /* * If the BIOS didn't enable everything it could, fall back to have the