From: Thomas Zimmermann <tzimmermann@suse.de>
To: daniel@ffwll.ch, airlied@gmail.com,
maarten.lankhorst@linux.intel.com, mripard@kernel.org
Cc: Thomas Zimmermann <tzimmermann@suse.de>, dri-devel@lists.freedesktop.org
Subject: [PATCH 1/3] Revert "drm/fb-helper: Remove damage worker"
Date: Fri, 18 Nov 2022 14:35:33 +0100 [thread overview]
Message-ID: <20221118133535.9739-2-tzimmermann@suse.de> (raw)
In-Reply-To: <20221118133535.9739-1-tzimmermann@suse.de>
This reverts commit 27c3e9452d552ea86369a94f23287a9675f2d7a1.
Needed to restore the fbdev damage worker. There have been bug reports
about locking order [1] and incorrectly takens branches. [2] Restore
the damage worker until these problems have been resovled.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://intel-gfx-ci.01.org/tree/drm-tip/fi-kbl-8809g.html # 1
Link: https://lore.kernel.org/dri-devel/20221115115819.23088-6-tzimmermann@suse.de/T/#m06eedc0a468940e4cbbd14ca026733b639bc445a # 2
---
drivers/gpu/drm/drm_fb_helper.c | 9 +++++++++
include/drm/drm_fb_helper.h | 2 ++
2 files changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index a1f86e436ae8e..c0e9a977a3b3c 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -403,6 +403,13 @@ static void drm_fb_helper_fb_dirty(struct drm_fb_helper *helper)
spin_unlock_irqrestore(&helper->damage_lock, flags);
}
+static void drm_fb_helper_damage_work(struct work_struct *work)
+{
+ struct drm_fb_helper *helper = container_of(work, struct drm_fb_helper, damage_work);
+
+ drm_fb_helper_fb_dirty(helper);
+}
+
/**
* drm_fb_helper_prepare - setup a drm_fb_helper structure
* @dev: DRM device
@@ -418,6 +425,7 @@ void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,
INIT_LIST_HEAD(&helper->kernel_fb_list);
spin_lock_init(&helper->damage_lock);
INIT_WORK(&helper->resume_work, drm_fb_helper_resume_worker);
+ INIT_WORK(&helper->damage_work, drm_fb_helper_damage_work);
helper->damage_clip.x1 = helper->damage_clip.y1 = ~0;
mutex_init(&helper->lock);
helper->funcs = funcs;
@@ -549,6 +557,7 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper)
return;
cancel_work_sync(&fb_helper->resume_work);
+ cancel_work_sync(&fb_helper->damage_work);
info = fb_helper->info;
if (info) {
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 455f6c2b8117a..b111dc7ada78d 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -116,6 +116,7 @@ struct drm_fb_helper_funcs {
* @damage_clip: clip rectangle used with deferred_io to accumulate damage to
* the screen buffer
* @damage_lock: spinlock protecting @damage_clip
+ * @damage_work: worker used to flush the framebuffer
* @resume_work: worker used during resume if the console lock is already taken
*
* This is the main structure used by the fbdev helpers. Drivers supporting
@@ -145,6 +146,7 @@ struct drm_fb_helper {
u32 pseudo_palette[17];
struct drm_clip_rect damage_clip;
spinlock_t damage_lock;
+ struct work_struct damage_work;
struct work_struct resume_work;
/**
--
2.38.1
next prev parent reply other threads:[~2022-11-18 13:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 13:35 [PATCH 0/3] drm/fb-helper: Restore damage worker Thomas Zimmermann
2022-11-18 13:35 ` Thomas Zimmermann [this message]
2022-11-18 13:35 ` [PATCH 2/3] Revert "drm/fb-helper: Schedule deferred-I/O worker after writing to framebuffer" Thomas Zimmermann
2022-11-18 13:35 ` [PATCH 3/3] Revert "drm/fb-helper: Perform damage handling in deferred-I/O helper" Thomas Zimmermann
2022-11-19 11:15 ` [PATCH 0/3] drm/fb-helper: Restore damage worker Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221118133535.9739-2-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).