<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<p><br>
</p>
<div style="color: rgb(0, 0, 0);">
<div>
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Michel Dänzer <michel@daenzer.net><br>
<b>Sent:</b> Tuesday, August 22, 2017 1:52 AM<br>
<b>To:</b> Abramov, Slava<br>
<b>Cc:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH xf86-video-amdgpu 04/10] Create drmmode_crtc_wait_pending_event helper macro</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">On 18/08/17 11:51 PM, Abramov, Slava wrote:<br>
> *From:* amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of<br>
> <br>
>> diff --git a/src/drmmode_display.c b/src/drmmode_display.c<br>
>> index 1a805b82d..bdd3866b8 100644<br>
>> --- a/src/drmmode_display.c<br>
>> +++ b/src/drmmode_display.c<br>
>> @@ -96,6 +96,14 @@ AMDGPUZaphodStringMatches(ScrnInfoPtr pScrn, const<br>
>> char *s, char *output_name)<br>
>> return FALSE;<br>
>> }<br>
>> <br>
>> +<br>
>> +/* Wait for the boolean condition to be FALSE */<br>
>> +#define drmmode_crtc_wait_pending_event(drmmode_crtc, fd, condition) \<br>
>> + do {} while ((condition) && \<br>
>> + drmHandleEvent(fd,<br>
>> &drmmode_crtc->drmmode->event_context) \<br>
>> + > 0);<br>
>> +<br>
>> +<br>
> <br>
> [slava] The comment seems a little misleading to me. The loop condition<br>
> has actually two parts, and it's unclear what we're actually waiting<br>
> for. A side question: is it expected that the variable 'condition' will<br>
> change while we're waiting?<br>
<br>
Yes, that's the whole point. :) While (condition) evaluates to non-0, we<br>
call drmHandleEvent(), which blocks until at least one DRM event<br>
arrives, and triggers processing of arrived DRM events.<br>
<br>
Maybe something like this would be better?<br>
<br>
/* If condition evaluates to TRUE, process DRM events until condition<br>
* evaluates to FALSE.<br>
*/</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">[slava] Yes, I like that :)<br>
<br>
<br>
Anyway, this patch just ports the same change from xf86-video-ati, so<br>
I'm not going to modify the comment in this patch. Do you want to send a<br>
patch modifying the comment in either driver?</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">[slava] I will try to do this, as a military exercise, to get use to the process
<span>😊 </span><br>
</div>
<div class="PlainText"><span><br>
</span></div>
<div class="PlainText"><span><br>
</span></div>
<div class="PlainText"><span>Slava</span></div>
</span></font></div>
</div>
</body>
</html>