* [PATCH xf86-video-ati 1/2] Fix flip event data leak if calloc or drmModeAddFB fails
@ 2017-02-07 9:47 Michel Dänzer
[not found] ` <20170207094737.13109-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Michel Dänzer @ 2017-02-07 9:47 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
From: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
src/drmmode_display.c | 4 +++-
src/radeon_dri2.c | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 314d63989..b64be462d 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2958,8 +2958,10 @@ error:
radeon_drm_abort_entry(drm_queue_seq);
else if (crtc)
drmmode_flip_abort(crtc, flipdata);
- else if (flipdata && flipdata->flip_count <= 1)
+ else {
+ abort(NULL, data);
free(flipdata);
+ }
xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Page flip failed: %s\n",
strerror(errno));
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 860ff2904..d0dcf8906 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -579,9 +579,9 @@ xf86CrtcPtr radeon_dri2_drawable_crtc(DrawablePtr pDraw, Bool consider_disabled)
static void
radeon_dri2_flip_event_abort(xf86CrtcPtr crtc, void *event_data)
{
- RADEONInfoPtr info = RADEONPTR(crtc->scrn);
+ if (crtc)
+ RADEONPTR(crtc->scrn)->drmmode.dri2_flipping = FALSE;
- info->drmmode.dri2_flipping = FALSE;
free(event_data);
}
--
2.11.0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH xf86-video-ati 2/2] Don't destroy current FB if drmModeAddFB fails
[not found] ` <20170207094737.13109-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2017-02-07 9:47 ` Michel Dänzer
[not found] ` <20170207094737.13109-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Michel Dänzer @ 2017-02-07 9:47 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
From: Michel Dänzer <michel.daenzer@amd.com>
It would probably result in a black screen.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
src/drmmode_display.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index b64be462d..c39b32558 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2949,7 +2949,8 @@ flip_error:
strerror(errno));
error:
- if (flipdata && flipdata->flip_count <= 1) {
+ if (flipdata && flipdata->flip_count <= 1 &&
+ drmmode->fb_id != flipdata->old_fb_id) {
drmModeRmFB(drmmode->fd, drmmode->fb_id);
drmmode->fb_id = flipdata->old_fb_id;
}
--
2.11.0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH xf86-video-ati 2/2] Don't destroy current FB if drmModeAddFB fails
[not found] ` <20170207094737.13109-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2017-02-07 16:20 ` Deucher, Alexander
0 siblings, 0 replies; 3+ messages in thread
From: Deucher, Alexander @ 2017-02-07 16:20 UTC (permalink / raw)
To: 'Michel Dänzer', amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Michel Dänzer
> Sent: Tuesday, February 07, 2017 4:48 AM
> To: amd-gfx@lists.freedesktop.org
> Subject: [PATCH xf86-video-ati 2/2] Don't destroy current FB if
> drmModeAddFB fails
>
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> It would probably result in a black screen.
>
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Series is:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> src/drmmode_display.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index b64be462d..c39b32558 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -2949,7 +2949,8 @@ flip_error:
> strerror(errno));
>
> error:
> - if (flipdata && flipdata->flip_count <= 1) {
> + if (flipdata && flipdata->flip_count <= 1 &&
> + drmmode->fb_id != flipdata->old_fb_id) {
> drmModeRmFB(drmmode->fd, drmmode->fb_id);
> drmmode->fb_id = flipdata->old_fb_id;
> }
> --
> 2.11.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-07 16:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07 9:47 [PATCH xf86-video-ati 1/2] Fix flip event data leak if calloc or drmModeAddFB fails Michel Dänzer
[not found] ` <20170207094737.13109-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-02-07 9:47 ` [PATCH xf86-video-ati 2/2] Don't destroy current FB if " Michel Dänzer
[not found] ` <20170207094737.13109-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-02-07 16:20 ` Deucher, Alexander
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.