From patchwork Thu Feb 26 22:48:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Konno X-Patchwork-Id: 5896501 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8AA52BF440 for ; Thu, 26 Feb 2015 22:48:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B1C3D20395 for ; Thu, 26 Feb 2015 22:48:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7356220304 for ; Thu, 26 Feb 2015 22:48:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8FAAE6E09A; Thu, 26 Feb 2015 14:48:39 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTP id DB0C96E09A for ; Thu, 26 Feb 2015 14:48:37 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 26 Feb 2015 14:42:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,655,1418112000"; d="scan'208";a="533451698" Received: from jbkonno-beef.jf.intel.com ([10.7.197.52]) by orsmga003.jf.intel.com with ESMTP; 26 Feb 2015 14:39:24 -0800 From: Joe Konno To: intel-gfx@lists.freedesktop.org Date: Thu, 26 Feb 2015 14:48:44 -0800 Message-Id: <1424990924-27220-1-git-send-email-joe.konno@linux.intel.com> X-Mailer: git-send-email 2.3.0 Subject: [Intel-gfx] [PATCH] drm/i915: Redo WMs when cursor size changes X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Joe Konno In instances where cursor sizes change, as in Chromium Ozone/Freon, watermarks should be recomputed. There should be no hard-coded assumptions about cursor widths. This was corrected originally here: commit 64f962e3e38bf6f40bbd2462f8380dee0369e1bf Author: Chris Wilson Date: Wed Mar 26 12:38:15 2014 +0000 drm/i915: Recompute WM when the cursor size changes However, it seems the recompute logic got lost in refactoring. Re-introduce the relevant WM re-compute code from the original patch. Cc: Chris Wilson Cc: Matt Roper Fixes: 32b7eeec4d1e ("drm/i915: Refactor work that can sleep out of commit (v7)") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89346 Signed-off-by: Joe Konno Tested-by: James Ausmus --- drivers/gpu/drm/i915/intel_display.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index b0f113d9daab..c5cbfea0551e 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -12234,6 +12234,7 @@ intel_commit_cursor_plane(struct drm_plane *plane, struct intel_plane *intel_plane = to_intel_plane(plane); struct drm_i915_gem_object *obj = intel_fb_obj(state->base.fb); uint32_t addr; + unsigned old_width; crtc = crtc ? crtc : plane->crtc; intel_crtc = to_intel_crtc(crtc); @@ -12243,6 +12244,7 @@ intel_commit_cursor_plane(struct drm_plane *plane, crtc->cursor_y = state->base.crtc_y; intel_plane->obj = obj; + old_width = intel_crtc->cursor_width; if (intel_crtc->cursor_bo == obj) goto update; @@ -12260,8 +12262,11 @@ update: intel_crtc->cursor_width = state->base.crtc_w; intel_crtc->cursor_height = state->base.crtc_h; - if (intel_crtc->active) + if (intel_crtc->active) { + if (old_width != intel_crtc->cursor_width) + intel_update_watermarks(crtc); intel_crtc_update_cursor(crtc, state->visible); + } } static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,