Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp745068ybt; Wed, 8 Jul 2020 10:37:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVDGiGSvC8AM9U0sn5zs19c5x5ro7WONcb8AfmsFa0Bemd2OpQLJu/BY8OzyBRf8ZuEYR+ X-Received: by 2002:a17:906:7751:: with SMTP id o17mr54739576ejn.111.1594229826659; Wed, 08 Jul 2020 10:37:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594229826; cv=none; d=google.com; s=arc-20160816; b=buhdnFX9XG0SNNRNu260BRELuRT5+hn0jkMAp1H7J4ZBND9Z2FojP45pCyYjvVemMr vMErZ/kxvfq1J7oKYb058L2byM5zCNwyYJXTOTSeEL0pEd1E7qiOtfPYPXjuXw8sz5B3 T0taUyspeCkf4dPyFRdxGJf5IaG5PrwXF4aA+YSZ81hBUpPnuNk1esEdDoQblIYJbM9Z MQEVUEOPiXKPOBrETGzV3TGa4qkjdp4X+OrGL8tAneP1UIm74vtTsnSaKk0+BPbaId7h w1eJgsGuys+w2EnbsS6Wv1THyruN9URDGI1S9VKbXLJAuPkhizyGkFy+yPC/LLFnIRrh MIhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=WOVkqwckQQd55xs9l2xekP/piuHMiACO9inQRc/624Y=; b=p4vJBh2YqOlLGfL1cqZ5tTS5ri5aFWVMqrHCbMqS7t8m5QMH7MRFKpwYKHae97LYX/ ovOuM0GApVTHnTEHYgfCb71Y1MHxh+VMKXjD3sPWrW7O7YPsDRNsx++F5AUFDw9EhTSJ TdWUSHv0p8KDoyi1vxpvb8sgmBvTgpQo6vZc140DOmNJlYc/WzbZ7oUMqQbl3+lxpRXI /6R9OXDhm11hXhqI8adsZ5If9eJJUTHqAHxrBlMfXUzU70OgVjlAS98okYxi7NylUAj5 f5EFI/ZrY7I3aVO0B7brx2TJDCHC0uLeUoX/+Jlo2XjjInIwGsxXvuRBzdtnifnbY68Z ugqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flowbird.group header.s=google header.b=TtGG4LDi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flowbird.group Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c25si329114ejd.178.2020.07.08.10.36.42; Wed, 08 Jul 2020 10:37:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@flowbird.group header.s=google header.b=TtGG4LDi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flowbird.group Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730442AbgGHQyM (ORCPT + 99 others); Wed, 8 Jul 2020 12:54:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730339AbgGHQyL (ORCPT ); Wed, 8 Jul 2020 12:54:11 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54DA5C061A0B for ; Wed, 8 Jul 2020 09:54:11 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id a6so49750975wrm.4 for ; Wed, 08 Jul 2020 09:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flowbird.group; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WOVkqwckQQd55xs9l2xekP/piuHMiACO9inQRc/624Y=; b=TtGG4LDilrrh105PxPZxfegeCFu329cU+BDYujVlSNPA/eV+N5rQLeSu4f9VNLv4EY jJXnMpeYSsY9v5ysdriB/Hdv7bPmV6ebu0WLsdR5QtuofFwIKWHA25JdHRc8aJmzbtST dkPMA8o+wOk1I1iqtY8N8XkkS8AY9V/RXRrRmMpZhOHeETr6llzVlatZu8t4uIRUziB/ pZCHiO5QP8ZfoMsI13oKDv2l5Sao7jE9NVeqdVzNS8i7Sp+FU7KFZsf/qKt9IB8E1irm 0YehjaJ5rDST1wEhuW7LtWdNQ/+HKsI9krgqqI7O7wAyVZ2Wm6XV9+9fRTczuXASdmoi Q0Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WOVkqwckQQd55xs9l2xekP/piuHMiACO9inQRc/624Y=; b=AbzpUCrNa8839lByWpY/VvJaGJVr/YOSf1i/5xOCO8CNhTdDqpT7ZW6YnQ7VG6aRY2 nhhp/w4fp247pz0aRG9g+0rgyOv/BwFa+35BiTX1G+QBf3RpWp2n/7XpurSbg1ha5WOf f4GG9mQW3wmmV524qUMG/7h0viP/vnnu4oewI089cc4cu5HzUVmuwT/kmzp38AmSFTrF klLdoazqWkGpinypeLQSZmRkbKtIjt8L8+ElBcuHIFQ9NYSEjb6squWk11eDyTh+1ni/ 9ceNrpgBpJwFlaH37kCmj0Viadk9WwCVwPeTnTImQ1zbgZ4DLxjNc1F1Go2OlsxovFzb 1eLQ== X-Gm-Message-State: AOAM5326vxPOe8uGITHriWh438Q2Qjlo1wWeoHzR/KCM9AktNpEQ8ItM 1s8cLON1V8KtjqyBOj06IYMGXdSY74sOWiah8FSFUg== X-Received: by 2002:adf:9062:: with SMTP id h89mr55137959wrh.285.1594227249993; Wed, 08 Jul 2020 09:54:09 -0700 (PDT) MIME-Version: 1.0 References: <1594137527-15201-1-git-send-email-martin.fuzzey@flowbird.group> In-Reply-To: From: "Fuzzey, Martin" Date: Wed, 8 Jul 2020 18:53:59 +0200 Message-ID: Subject: Re: [PATCH] drm: imx: Fix occasional screen corruption on modeset. To: Philipp Zabel Cc: Shawn Guo , Sascha Hauer , ML dri-devel , "Linux-Kernel@Vger. Kernel. Org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Philipp, thanks for the quick reply. On Wed, 8 Jul 2020 at 10:31, Philipp Zabel wrote: > Could this be just a panel getting confused because the pixel clock is > disabled, or is there really an issue with the IPU? Have you tried just > keeping clk_di_pixel enabled in ipu_di_disable(), but continuing > to disable DI and DC? > I've tried that now but still observed the corruption. > > The exact reason isn't understood but it seems timing related. > > Also just adding a msleep(2) or a mdelay(20) at the end of ipu_crtc_atomic_disable() makes the problem go away too. Obviously I'm not suggesting doing that, just that it may help understand what is going on. > > Just removing ipu_di_disable() leaks a clk_prepare_enable refcount on > the di->clk_di_pixel clock. > > Also this is followed by an ipu_dc_disable(), which should remove the DC > module's clock if this is the only display. So the DC should be disabled > anyway. > True. How about doing just ipu_crtc_disable_planes() and drm_crtc_vblank_off() in the active (modeset) case. and in ipu_crtc_atomic_enable() only doing the stuff (which doesn't touch the planes) if old_state->active == false ? That will fix the clock refcount problem and seems generally better as tearing down everything just to do a modeset seems a bit heavy handed. I've tested that and it works too but it's probably better to discuss this some more before sending a new patch. Regards, Martin