From: Ilija Hadzic <ihadzic@research.bell-labs.com>
To: airlied@gmail.com, dri-devel@lists.freedesktop.org
Cc: Ilija Hadzic <ihadzic@research.bell-labs.com>
Subject: [PATCH 2/6] drm: eliminate old_fb from drm_crtc_helper_set_config
Date: Tue, 29 Oct 2013 11:09:42 -0400 [thread overview]
Message-ID: <1383059386-20917-3-git-send-email-ihadzic@research.bell-labs.com> (raw)
In-Reply-To: <1383059386-20917-1-git-send-email-ihadzic@research.bell-labs.com>
Old framebuffer is stored in save_set.fb and it is
the same value that is later stored in old_fb.
This makes old_fb redundant so we can replace
it with save_set.fb.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
---
drivers/gpu/drm/drm_crtc_helper.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index d0ac595..b06a6c4 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -595,7 +595,6 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
struct drm_device *dev;
struct drm_crtc *save_crtcs, *new_crtc, *crtc;
struct drm_encoder *save_encoders, *new_encoder, *encoder;
- struct drm_framebuffer *old_fb = NULL;
bool mode_changed = false; /* if true do a full mode set */
bool fb_changed = false; /* if true and !mode_changed just do a flip */
struct drm_connector *save_connectors, *connector;
@@ -790,14 +789,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
DRM_DEBUG_KMS("attempting to set mode from"
" userspace\n");
drm_mode_debug_printmodeline(set->mode);
- old_fb = set->crtc->fb;
set->crtc->fb = set->fb;
if (!drm_crtc_helper_set_mode(set->crtc, set->mode,
set->x, set->y,
- old_fb)) {
+ save_set.fb)) {
DRM_ERROR("failed to set mode on [CRTC:%d]\n",
set->crtc->base.id);
- set->crtc->fb = old_fb;
+ set->crtc->fb = save_set.fb;
ret = -EINVAL;
goto fail;
}
@@ -812,13 +810,11 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
} else if (fb_changed) {
set->crtc->x = set->x;
set->crtc->y = set->y;
-
- old_fb = set->crtc->fb;
set->crtc->fb = set->fb;
ret = crtc_funcs->mode_set_base(set->crtc,
- set->x, set->y, old_fb);
+ set->x, set->y, save_set.fb);
if (ret != 0) {
- set->crtc->fb = old_fb;
+ set->crtc->fb = save_set.fb;
goto fail;
}
}
--
1.8.2.1
next prev parent reply other threads:[~2013-10-29 15:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 15:09 fix for CRTC mutex corruption Ilija Hadzic
2013-10-29 15:09 ` [PATCH 1/6] drm: remove redundant if statement Ilija Hadzic
2013-10-29 15:09 ` Ilija Hadzic [this message]
2013-10-29 15:09 ` [PATCH 3/6] drm: restore crtc origin if mode_set_base fails Ilija Hadzic
2013-10-29 15:09 ` [PATCH 4/6] drm: fix error recovery path in drm_crtc_helper_set_mode Ilija Hadzic
2013-10-29 15:09 ` [PATCH 5/6] drm: do not set crtc enabled field twice Ilija Hadzic
2013-10-29 15:09 ` [PATCH 6/6] drm: eliminate bit-copy restoration of crtc Ilija Hadzic
2013-10-29 18:40 ` fix for CRTC mutex corruption Daniel Vetter
2013-10-29 19:22 ` Ilija Hadzic
2013-10-29 20:11 ` Daniel Vetter
2013-10-30 13:45 ` Ilija Hadzic
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=1383059386-20917-3-git-send-email-ihadzic@research.bell-labs.com \
--to=ihadzic@research.bell-labs.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.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).