From patchwork Wed Dec 21 11:19:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Hogander, Jouni" X-Patchwork-Id: 13078657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E0A1BC10F1B for ; Wed, 21 Dec 2022 11:20:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C66D410E13A; Wed, 21 Dec 2022 11:20:02 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3557A10E13B; Wed, 21 Dec 2022 11:19:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671621597; x=1703157597; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=V41ohy1Xm/2UniAlRqfcxo5E0ljd3+B0EKVPZXFsyaw=; b=Foee5XgitAwMCtBjuyYF9dn7DDv/6Lra2orkLIXuq3b26Km3CjzuaGdg uLwZ2/3F5lkbsv29dGVJuvLH2SEDXbXTN1Q8FeqBI10tbD7Xs54IJ4aFh N6O0lmWAUzpjQNY6P64NiUc4QME0z2XP3DihNI5NyjLb1zV0hv9QLzfFT v0xLzy9Oj7j5oFjJbwLVm/o0BjdGMwaYLpJeDnbol+vrvo2b4RBC71YOh E5nd9fianMd+TE+FGkpNAh4yVFdJbYZp2V0qTE+oLz/ddrSczrnTWd12t T+DbDp+5YLrIPdqrzuBIhXrXPZXN9zP0/LCXvgTB1qaC50+8f0YjdZ3D1 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10567"; a="321024994" X-IronPort-AV: E=Sophos;i="5.96,262,1665471600"; d="scan'208";a="321024994" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2022 03:19:56 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10567"; a="758480055" X-IronPort-AV: E=Sophos;i="5.96,262,1665471600"; d="scan'208";a="758480055" Received: from cbenthin-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.ger.corp.intel.com) ([10.252.61.207]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2022 03:19:53 -0800 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Date: Wed, 21 Dec 2022 13:19:01 +0200 Message-Id: <20221221111902.1742095-2-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221221111902.1742095-1-jouni.hogander@intel.com> References: <20221221111902.1742095-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH 1/2] drm/i915/fbdev: Implement fb_dirty for intel custom fb helper X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jani Nikula , Thomas Zimmermann Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" After splitting generic drm_fb_helper into it's own file it's left to helper implementation to have fb_dirty function. Currently intel fb doesn't have it. This is causing problems to features (PSR, FBC, DRRS) relying on dirty callback. Implement simple fb_dirty callback to deliver notifications about updates in fb console. v2: Improved commit message and added Fixes tag Fixes: 8ab59da26bc0 ("drm/fb-helper: Move generic fbdev emulation into separate source file") Cc: Ville Syrjälä Cc: Thomas Zimmermann Cc: Jani Nikula Signed-off-by: Jouni Högander --- drivers/gpu/drm/i915/display/intel_fbdev.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c index 03ed4607a46d..20bbdeaf2e6f 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.c +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c @@ -328,8 +328,17 @@ static int intelfb_create(struct drm_fb_helper *helper, return ret; } +static int intelfb_dirty(struct drm_fb_helper *helper, struct drm_clip_rect *clip) +{ + if (helper->fb->funcs->dirty) + return helper->fb->funcs->dirty(helper->fb, NULL, 0, 0, clip, 1); + + return 0; +} + static const struct drm_fb_helper_funcs intel_fb_helper_funcs = { .fb_probe = intelfb_create, + .fb_dirty = intelfb_dirty, }; static void intel_fbdev_destroy(struct intel_fbdev *ifbdev) From patchwork Wed Dec 21 11:19:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Hogander, Jouni" X-Patchwork-Id: 13078658 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A9322C4332F for ; Wed, 21 Dec 2022 11:20:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0584A10E18C; Wed, 21 Dec 2022 11:20:07 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0AA7B10E105; Wed, 21 Dec 2022 11:20:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671621600; x=1703157600; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nJ3suGLQLpyZaGV0yISOYfYzuaWJKxt3+x0NrUwC618=; b=VcJXCLMs1fykZtCb68T4ZdzBZBkXeDogXP/kBvWLFMzctXV2a/FkUijN V+xICyFUhLvpTva6m848CGLAbwBNA00Xl7hPY6zJQ9o2YJWcIKp5mXkj4 tIeDo3gZ9WPEmGWSPXIMkmUuuNxEVSZ2wKVS1RyFRG6Jlef3qhNQC27wO KncdN2x+7aDn47G9ip6dm3Ee87ZbVjat7EPaAoTc30q3w7wnRVphTig4J fhnl58GtnDjmQAm234O+CsfcFrQZPzbd1YKRVCrAMpRc58MP7+fEbCrUk CuJzAzG86tFN0oYprWxgsl4+CD1YIe4rsaAu2Rj2zXXFoWxxCw+J/SooA A==; X-IronPort-AV: E=McAfee;i="6500,9779,10567"; a="321025007" X-IronPort-AV: E=Sophos;i="5.96,262,1665471600"; d="scan'208";a="321025007" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2022 03:19:59 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10567"; a="758480060" X-IronPort-AV: E=Sophos;i="5.96,262,1665471600"; d="scan'208";a="758480060" Received: from cbenthin-mobl1.amr.corp.intel.com (HELO jhogande-mobl1.ger.corp.intel.com) ([10.252.61.207]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2022 03:19:57 -0800 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Date: Wed, 21 Dec 2022 13:19:02 +0200 Message-Id: <20221221111902.1742095-3-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221221111902.1742095-1-jouni.hogander@intel.com> References: <20221221111902.1742095-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH 2/2] drm/fbdev: Move damage clip check to higher level X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jani Nikula , Thomas Zimmermann Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Checking if damage clip is valid is common to all fb helpers. Makes more sense to check it in higher level than adding into all helpers. Cc: Ville Syrjälä Cc: Thomas Zimmermann Cc: Jani Nikula Signed-off-by: Jouni Högander --- drivers/gpu/drm/drm_fb_helper.c | 4 ++++ drivers/gpu/drm/drm_fbdev_generic.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index b3a731b9170a..78c889dbc610 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -384,6 +384,10 @@ static void drm_fb_helper_fb_dirty(struct drm_fb_helper *helper) clip->x2 = clip->y2 = 0; spin_unlock_irqrestore(&helper->damage_lock, flags); + /* Call damage handlers only if necessary */ + if (!(clip_copy.x1 < clip_copy.x2 && clip_copy.y1 < clip_copy.y2)) + return; + ret = helper->funcs->fb_dirty(helper, &clip_copy); if (ret) goto err; diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 0a4c160e0e58..6c6bb0dd2ea8 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -334,10 +334,6 @@ static int drm_fbdev_fb_dirty(struct drm_fb_helper *helper, struct drm_clip_rect if (!drm_fbdev_use_shadow_fb(helper)) return 0; - /* Call damage handlers only if necessary */ - if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2)) - return 0; - if (helper->buffer) { ret = drm_fbdev_damage_blit(helper, clip); if (drm_WARN_ONCE(dev, ret, "Damage blitter failed: ret=%d\n", ret))