[PATCH xf86-video-amdgpu 06/13] DRI2: Move amdgpu_dri2_flip_event_handler
Michel Dänzer
michel at daenzer.net
Sun Jun 7 19:48:03 PDT 2015
On 04.06.2015 00:11, Reverend Homer wrote:
> On 02.06.2015 12:21, Michel Dänzer wrote:
>> From: Michel Dänzer <michel.daenzer at amd.com>
>>
>> In preparation for the next change, which will modify it to a static
>> function which needs to be in the new place. No functional change.
>>
>> (Cherry picked from radeon commit
>> c3fa22a479e61d1899fa9d327d9c4e2a7f64b0c1)
>>
>> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
>> ---
>> src/amdgpu_dri2.c | 120
>> +++++++++++++++++++++++++++---------------------------
>> 1 file changed, 60 insertions(+), 60 deletions(-)
>>
>> diff --git a/src/amdgpu_dri2.c b/src/amdgpu_dri2.c
>> index fd98fa7..c139dec 100644
>> --- a/src/amdgpu_dri2.c
>> +++ b/src/amdgpu_dri2.c
>> @@ -497,6 +497,66 @@ xf86CrtcPtr amdgpu_dri2_drawable_crtc(DrawablePtr
>> pDraw, Bool consider_disabled)
>> return NULL;
>> }
>> +void amdgpu_dri2_flip_event_handler(unsigned int frame, unsigned
>> int tv_sec,
>> + unsigned int tv_usec, void *event_data)
>> +{
>> + DRI2FrameEventPtr flip = event_data;
>> + DrawablePtr drawable;
>> + ScreenPtr screen;
>> + ScrnInfoPtr scrn;
>> + int status;
>> + PixmapPtr pixmap;
>> +
>> + status = dixLookupDrawable(&drawable, flip->drawable_id,
>> serverClient,
>> + M_ANY, DixWriteAccess);
>> + if (status != Success) {
>> + free(flip);
>> + return;
>> + }
> Here
>> + if (!flip->crtc) {
>> + free(flip);
>> + return;
>> + }
> and here you are doing one thing. Wouldn't be better to use
> if (status != Success || !flip->crtc) {
> free(flip);
> return;
> }
> ?
Thank you for the review and the suggestion. However, the purpose of
this patch is to move the function to a different location without
modifying the function itself.
Feel free to submit a patch to improve the function itself. (Is
"Reverend Homer" your real name though?)
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the xorg-driver-ati
mailing list