Mark debug_print with __attribute__ ((format(__printf__, 1, 0)))

the drmServerInfo member, debug_print, takes a printf format string
and varargs list. Tell the compiler about it.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
drm: Initialize or valgrind-clear modesetting ioctl arguments.

Fixes valgrind complaints in the modesetting driver.  I tried to
follow each ioctl's pattern for whether it was initializing just the
in values, or both in and out values.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
intel: Track whether a buffer is idle to avoid trips to the kernel.

I've seen a number of apps spending unreasonable amounts of time in
drm_intel_bo_busy during the buffer mapping process.

We can't track idleness in general, in the case of buffers shared
across processes.  But this should significantly reduce our overhead
for checking for busy on things like VBOs.

Improves (unoptimized) glamor x11perf -f8text by 0.243334% +/-
0.161498% (n=1549), which has formerly been spending about .5% of its
time hitting the kernel for drm_intel_gem_bo_busy().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
intel: Create a new drm_intel_bo offset64 field.

The existing 'offset' field is unfortunately typed as 'unsigned long',
which is unfortunately only 4 bytes with a 32-bit userspace.

Traditionally, the hardware has only supported 32-bit virtual addresses,
so even though the kernel uses a __u64, the value would always fit.

However, Broadwell supports 48-bit addressing.  So with a 64-bit kernel,
the card virtual address may be too large to fit in the 'offset' field.

Ideally, we would change the type of 'offset' to be a uint64_t---but
this would break the libdrm ABI.  Instead, we create a new 'offset64'
field to hold the full 64-bit value from the kernel, and store the
32-bit truncation in the existing 'offset' field, for compatibility.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bump the version to 2.4.52

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
modeprint: pretty print connector names

Use same names as the kernel, makes it easier to identify
connectors in the common case.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
drm: Implement drmCheckModesettingSupported() for FreeBSD

Add the missing implementation of drmCheckModesettingSupported()
to detect KMS support on FreeBSD (and GNU/kFreeBSD).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72847
Signed-off-by: Konstantin Belousov <kib@freebsd.org>
Signed-off-by: Robert Millan <rmh@freebsd.org>
freedreno: fix license

The userspace headers were intended to be BSD license.

Signed-off-by: Rob Clark <robclark@freedesktop.org>