From patchwork Thu Apr 26 15:25:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 10366191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7BA7F601D3 for ; Thu, 26 Apr 2018 15:25:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C40C2907F for ; Thu, 26 Apr 2018 15:25:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 612682908A; Thu, 26 Apr 2018 15:25:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 47C8A2907F for ; Thu, 26 Apr 2018 15:25:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A4B6C6E725; Thu, 26 Apr 2018 15:25:18 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id C00FA6E725 for ; Thu, 26 Apr 2018 15:25:17 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Apr 2018 08:25:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,330,1520924400"; d="scan'208";a="35476489" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga008.fm.intel.com with SMTP; 26 Apr 2018 08:25:14 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 26 Apr 2018 18:25:13 +0300 Date: Thu, 26 Apr 2018 18:25:13 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Dave Jones , Linux Kernel , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , intel-gfx@lists.freedesktop.org Message-ID: <20180426152513.GR23723@intel.com> References: <20180423152713.2rrwwye3wfstbv5v@codemonkey.org.uk> <20180426131045.GH23723@intel.com> <20180426142719.fzivt2e6kialcbp4@codemonkey.org.uk> <20180426145614.GP23723@intel.com> <20180426151641.GQ23723@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180426151641.GQ23723@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [Intel-gfx] 4.17-rc2: Could not determine valid watermarks for inherited state X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Apr 26, 2018 at 06:16:41PM +0300, Ville Syrjälä wrote: > On Thu, Apr 26, 2018 at 05:56:14PM +0300, Ville Syrjälä wrote: > > On Thu, Apr 26, 2018 at 10:27:19AM -0400, Dave Jones wrote: > > > [ 1.176131] [drm:i9xx_get_initial_plane_config] pipe A/primary A with fb: size=800x600@32, offset=0, pitch 3200, size 0x1d4c00 > > > [ 1.176161] [drm:i915_gem_object_create_stolen_for_preallocated] creating preallocated stolen object: stolen_offset=0x0000000000000000, gtt_offset=0x0000000000000000, size=0x00000000001d5000 > > > [ 1.176312] [drm:intel_alloc_initial_plane_obj.isra.127] initial plane fb obj (ptrval) > > > [ 1.176351] [drm:intel_modeset_init] pipe A active planes 0x1 > > > [ 1.176456] [drm:drm_atomic_helper_check_plane_state] Plane must cover entire CRTC > > > [ 1.176481] [drm:drm_rect_debug_print] dst: 800x600+0+0 > > > [ 1.176494] [drm:drm_rect_debug_print] clip: 1366x768+0+0 > > > > OK, so that's the problem right there. The fb we took over from the > > BIOS was 800x600, but now we're trying to set up a 1366x768 mode. > > > > We seem to be missing checks to make sure the initial fb is actually > > big enough for the mode we're currently using :( > > Actually we do read out the pipe src size as 800x600 initially, which > make sense. And we even stuff that into the mode.h/vdisplay, so up to > that point everything is pretty much correct. It goes wrong is when > intel_modeset_readout_hw_state() calls intel_mode_from_pipe_config() > as that will override the h/vdisplay with the actual crtc timings > instead of the pipe src size. > > So I suppose we should be able to just add the sanity checks for the > fb vs. h/vdisplay, and at least we should get past this error. A > slightly bigger mystery is what will happen later when our pipe src > size doesn't actually agree with the h/vdisplay. The first modeset > will correct it, but we might want some kind of extra sanitize step > for fastboot type of stuff. Hmm. Or maybe we should just stick to the pipe src size. I'm curious whether this fixes the problem? diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 0f8c7389e87d..30824beedef7 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -15284,6 +15284,8 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) memset(&crtc->base.mode, 0, sizeof(crtc->base.mode)); if (crtc_state->base.active) { intel_mode_from_pipe_config(&crtc->base.mode, crtc_state); + crtc->base.mode.hdisplay = crtc_state->pipe_src_w; + crtc->base.mode.vdisplay = crtc_state->pipe_src_h; intel_mode_from_pipe_config(&crtc_state->base.adjusted_mode, crtc_state); WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode));