Skip to content
Commit 763f646d authored by Adrian Salido's avatar Adrian Salido Committed by Emil Velikov
Browse files

libdrm: reduce number of reallocations in drmModeAtomicAddProperty



When calling drmModeAtomicAddProperty allocation of memory
happens as needed in increments of 16 elements. This can be very
slow if there are multiple properties to be updated in an Atomic
Commit call.

Increase this to as many as can fit in a memory PAGE to avoid
having to reallocate memory too often.

Also this patch has a small one line perf tweak in
drmModeAtomicDuplicate() to only memcpy items to the cursor
position in order avoid copying the entire item array if its
mostly empty.

Cc: Sean Paul <seanpaul@chromium.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Marissa Wall <marissaw@google.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
[jstultz: Expanded commit message]
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
parent 225d73fd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment