From patchwork Fri Jun 12 16:00:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11601983 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE369913 for ; Fri, 12 Jun 2020 16:01:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9CC0B20835 for ; Fri, 12 Jun 2020 16:01:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="JQx9+syS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9CC0B20835 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F2F206EA04; Fri, 12 Jun 2020 16:01:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1541F6EA02 for ; Fri, 12 Jun 2020 16:01:15 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id l10so10241194wrr.10 for ; Fri, 12 Jun 2020 09:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C6aThnIT5TKug3TwFcMSP2pfu2HbEKHkPMXwj0VD06U=; b=JQx9+sySzXcsVyCIb9Q8p61its1Vy8G/EQe2xFMTzb8Uten81XUCRYlrkChq6jI/tJ 8UIuKPVoOv1qDHpYruK9bcl/9hXUdXUb5r5kbbmpcSZ/VP78MK7SMBjy46e1gc5l2ams QgsbDBEU2T4CT1piB279QxzRzr2QgTbYveeLM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C6aThnIT5TKug3TwFcMSP2pfu2HbEKHkPMXwj0VD06U=; b=rBf6UM2wW+BVSYa32iu/H+k3XSnUG0sd87f65RO3NYXTW2wkUcfKtn0rSKFFn/V1an s0Y1Edwsf9/z3U6wlPgZh7um2DJOYIDP38F0wAZI16jBfyFmM2wwFy/Sjwd3w7uko9Lh ALYLBNyLe0GWyJPMLGzhS8SYXn20SwsOTCd7DcTLF5SXj9z2XmuHPVrGmrWNmnXfu0En 6R1RrvHfYFxxo3lgy0KvabJcwfo+EQCYf6msvRnWlbz+/lfEHo577n3zUOHbodWkRfbR aQDEUnaO+1sIojzHk1fn8aU3Mx3K4VWEdepwj1XVB3X9o3552rGpzfB+qUehPeg1Aru7 IgBQ== X-Gm-Message-State: AOAM5309o7LHmu3G+pxh5W+o5zWb7S+Qdpz+A0BzfVKXO+Sc8ENz3G4V pC7u1ScPlrZU6uxbAPsAMhdueJe1J8A= X-Google-Smtp-Source: ABdhPJyK4CW5uIrePuVArJHSfm5/wErcIe2663hwPxlfblOGUaEaHYj0lz+k8DRK7JSNOpvAtE5yQg== X-Received: by 2002:a05:6000:1150:: with SMTP id d16mr15437313wrx.197.1591977672339; Fri, 12 Jun 2020 09:01:12 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id j5sm10801566wrq.39.2020.06.12.09.01.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2020 09:01:11 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 8/8] drm/tiny/repaper: Drop edp->enabled Date: Fri, 12 Jun 2020 18:00:56 +0200 Message-Id: <20200612160056.2082681-8-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200612160056.2082681-1-daniel.vetter@ffwll.ch> References: <20200612160056.2082681-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Same patch as the mipi-dbi one, atomic tracks this for us already, we just have to check the right thing. Signed-off-by: Daniel Vetter Cc: "Noralf Trønnes" Reviewed-by: Noralf Trønnes --- drivers/gpu/drm/tiny/repaper.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c index 08164e2a2d13..2e01cf0a9876 100644 --- a/drivers/gpu/drm/tiny/repaper.c +++ b/drivers/gpu/drm/tiny/repaper.c @@ -88,7 +88,6 @@ struct repaper_epd { u8 *line_buffer; void *current_frame; - bool enabled; bool cleared; bool partial; }; @@ -538,9 +537,6 @@ static int repaper_fb_dirty(struct drm_framebuffer *fb) int idx, ret = 0; u8 *buf = NULL; - if (!epd->enabled) - return 0; - if (!drm_dev_enter(fb->dev, &idx)) return -ENODEV; @@ -786,7 +782,6 @@ static void repaper_pipe_enable(struct drm_simple_display_pipe *pipe, */ repaper_write_val(spi, 0x02, 0x04); - epd->enabled = true; epd->partial = false; out_exit: drm_dev_exit(idx); @@ -805,13 +800,8 @@ static void repaper_pipe_disable(struct drm_simple_display_pipe *pipe) * unplug. */ - if (!epd->enabled) - return; - DRM_DEBUG_DRIVER("\n"); - epd->enabled = false; - /* Nothing frame */ for (line = 0; line < epd->height; line++) repaper_one_line(epd, 0x7fffu, NULL, 0x00, NULL, @@ -859,6 +849,9 @@ static void repaper_pipe_update(struct drm_simple_display_pipe *pipe, struct drm_plane_state *state = pipe->plane.state; struct drm_rect rect; + if (!pipe->crtc.state->active) + return; + if (drm_atomic_helper_damage_merged(old_state, state, &rect)) repaper_fb_dirty(state->fb); }