Commit Graph

9649 Commits

Author SHA1 Message Date
b-aaz
d4c894c8a6 meson: Automatically detect the default xorg-module-dir.
The module directory has changed to a per ABI folder in the xlibre-xserver.
Now the default value of `xorg-module-dir` will be detected from the `moduledir` variable in xorg-server.pc.

Signed-off-by: b-aaz <b-aazbsd.proton.me>
xlibre-xf86-video-intel-3.0.0.6
2025-12-06 20:06:17 +00:00
Enrico Weigelt, metux IT consult
91b7822654 drop obsolete check for HAS_DEVPRIVATEKEYREC
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
xlibre-xf86-video-intel-3.0.0.5
2025-11-27 18:30:14 +01:00
Enrico Weigelt, metux IT consult
e676c71504 drop obsolete check for videdrv abi > 10
xserver >= 1.18 has videdrv abi version 20.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 18:30:01 +01:00
Enrico Weigelt, metux IT consult
2960036ed3 drop obsolete XAA support
Since recent commits require xserver-1.18.0 or later to build against,
there's no reason leaving behind big chunks of code that can only build
against the XAA support removed in xserver-1.13.0 (released in 2012).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 18:29:50 +01:00
Enrico Weigelt, metux IT consult
9c4282c396 drop obsolete check for HAS_DIXREGISTERPRIVATEKEY
It's present since xserver 1.18

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 18:27:11 +01:00
Enrico Weigelt, metux IT consult
85494bf879 drop obsolete check for HAS_DIRTYTRACKING2
This had been long gone, before our olderst supported relase 1.18

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 18:25:24 +01:00
Enrico Weigelt, metux IT consult
37134bb03f drop unused _MSC_VER check
Probably a copy+paste bug: this driver doesn't work at all under Windows.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 18:23:46 +01:00
Enrico Weigelt, metux IT consult
4af8592df4 drop compat with ancient xserver versions
We're relying on at least 1.18 now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 18:21:27 +01:00
Enrico Weigelt, metux IT consult
935c612524 sna: declare the macros from micoord.h on our own
The <micoord.h> file is deprecated and this is the only driver actually
using it, so define them on our own.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 18:18:38 +01:00
Enrico Weigelt, metux IT consult
c181598ad1 bump minimal xorg version to 1.18
1.18 was released a decade ago, so it seems reasonable stop supporting
older ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 17:59:26 +01:00
Enrico Weigelt, metux IT consult
25f4892b66 sna: drop compile-time check for GLYPHPADBYTES == 4
It's always defined to 4, so extra check necessary.

See: xserver commit 17c3347f14822b9f7da4253c71f6ed51be2b38d1
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-06 15:53:00 +01:00
callmetango
ff03e6981b configure: fix missing include of <xorg-server.h>
Fixes: #19
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
xlibre-xf86-video-intel-3.0.0.4
2025-09-25 17:01:15 +02:00
Enrico Weigelt, metux IT consult
65469c32fd sna: sna_damage: fix missing include of extinit.h
> sna_video.c: In function 'sna_video_init':
> sna_video.c:956:13: error: 'noXvExtension' undeclared (first use in this function); did you mean 'XvExtension'?
>   956 |         if (noXvExtension)
>       |             ^~~~~~~~~~~~~
>       |             XvExtension

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
xlibre-xf86-video-intel-3.0.0.3
2025-09-24 15:31:42 +02:00
Enrico Weigelt, metux IT consult
fc8fd35b86 test: drop dead code
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-24 15:08:15 +02:00
Enrico Weigelt, metux IT consult
4ef542eb13 drop fd_move_cloexec()
There's really no need to duplicate fd to a trivial sysfs file, neither
any need to explicitly mark it as close-on-exec. There's no locking
whatsoever involved, even parallel writes are fully supported for
sysfs attribute files.

And the way it was done was really weird and fragile: it just brutely
overwrote fd # MAXCLIENTS. The MAXCLIENTS define is internal to the
Xserver, outside of individual driver's concern, and drivers really
shouldn't directly mess with the fd table that way - they have no way
to make sure it's really done right.

Therefore, just drop this all and leave the fd as it is.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-24 15:00:26 +02:00
callmetango
5e1e6554ed sna: fix missing include of <sys/select.h>
Include <sys/select.h> to provide timer_tv. Fixes the missing definition
when sna is enabled and udev is disabled in configure.

Fixes: #10
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
xlibre-xf86-video-intel-3.0.0.2
2025-08-07 17:27:45 -04:00
b-aaz
8c99260b4f configure: Automatically detect the default xorg-module-dir.
The module directory has changed to a per ABI folder in the xlibre-xserver.
Now the default value of `xorg-module-dir` will be detected from the `moduledir` variable in xorg-server.pc.

Signed-off-by: b-aaz <b-aazbsd.proton.me>
2025-07-29 18:56:00 +02:00
Enrico Weigelt, metux IT consult
a90192a5b1 fd: fix missing include of <xorg-server.h>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-25 16:06:47 +02:00
Enrico Weigelt, metux IT consult
5d4338daed .github: add CI pipeline
This pipeline builds the driver against the latest Xserver stable
release as well as current master.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-25 16:01:31 +02:00
callmetango
9748dfb595 .github: Add issue forms
Add the following forms for issue creation:

* Bug report
* Feature request
* Code change
* Documentation update
* Organizational task

* add issue type selection page on "New Issue" call
* mention Github Discussions and the mailing list where appropriate

Part-of: X11Libre/misc#156
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-07-07 17:05:44 +02:00
Enrico Weigelt, metux IT consult
524563666c sna: fix abuse of ancient AllocateFontPrivateIndex()
The AllocateFontPrivateIndex() is gone from Xserver since about a decade
ago, but the driver doensn't correctly detect it. Since there's really
no need to support an over a decade old Xserver anymore, just drop the
whole detection logic and use xfont2_allocate_font_private_index()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
xlibre-xf86-video-intel-3.0.0.1
2025-06-17 20:00:30 +02:00
Enrico Weigelt, metux IT consult
03e0296572 use xf86NameCmp() instead of xf86nameCompare()
This driver is the only one still using xf86nameCompare() and so
blocking it's removal from Xserver module ABI.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:19 +02:00
Enrico Weigelt, metux IT consult
0eb141f82c use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:19 +02:00
Enrico Weigelt, metux IT consult
5b60b8c27b Define __container_of only if not defined yet.
Silence warnings.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:19 +02:00
Enrico Weigelt, metux IT consult
7f83eb6586 meson.build: increase required version
tools/meson.build:45: WARNING: Project targets '>0.40.0' but uses feature introduced in '0.41.0': capture arg in configure_file.
377tools/meson.build:45: WARNING: Project targets '>0.40.0' but uses feature introduced in '0.50.0': install arg in configure_file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:19 +02:00
Enrico Weigelt, metux IT consult
521f6e21e3 sna: use xserver's bswap_32()
Some (non-BSD) platforms don't have <byteswap.h>, so better use the
Xserver's bswap_32() implementation here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:19 +02:00
Enrico Weigelt, metux IT consult
68f9155b65 use XNFcallocarray() instead of xnfcalloc macro
xnfcalloc is just an alias for XNFcallocarray() that doesn't seem to serve
any practical purpose, so it can go away once all drivers stopped using it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:19 +02:00
Enrico Weigelt, metux IT consult
93b00118ec use XNFalloc() instead of xnfalloc
xnfalloc is just an alias for XNFalloc() that doesn't seem to serve
any practical purpose, so it can go away once all drivers stopped using it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:19 +02:00
Enrico Weigelt, metux IT consult
c9f5f1ad3d uxa: stop calling deprecated xf86_reload_cursors()
the function has become a no-op, it's former duties are done automatically.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:19 +02:00
Enrico Weigelt, metux IT consult
192a2727a5 stop using obsolete xf86BlockSIGIO() and xf86UnblockSIGIO()
These are just wrappers for calling input_lock()/input_unlock() and marked
deprecated for quite a while now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:19 +02:00
Enrico Weigelt, metux IT consult
bc9cd47db5 gitlab CI: add pipeline for building against various Xserver releases
Adding a gitlab pipeline building this driver against Xserver major releases
since 1.18, including current master branch, on Debian as well as FreeBSD.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:18 +02:00
Enrico Weigelt, metux IT consult
57c68cf7d9 gitlab CI: common scripts for driver builds
Adding a bunch of common scripts for building xorg drivers on different
platforms (for now Debian and FreeBSD) against different server versions.

Also designed to be executed locally (eg. within a VM), so one doesn't
always have to employ f.d.o gitlab.

For now, these are synced manually across various driver repos, until we've
found a viable solution for a central place.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:18 +02:00
Enrico Weigelt, metux IT consult
f9aafdb067 sna: use GCPtr instead of GC *
Xserver includes have explicit pointer types for quite all kind of structs
(at least those used by drivers), which are used all over the Xserver.
Thus it's much cleaner to use those everywhere.

This commit also clears the road to fix a horrible nightmare of hacks just
needed to circumvent naming clashes between Xserver and Xlib (affecting all
DDXes that are painting on another Xserver): we can simply rename Xserver's
own "GC" type to "GCRec" (the usual naming convention here) and so no trouble
with Xlib's "GC" type anymore. Once this has landed, we're free to do that
without breaking this driver.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:18 +02:00
Enrico Weigelt, metux IT consult
3f9e8b20da backlight: use system() instead of System()
The Xserver's System() function is a special wrapper for calling a program
(xkbcomp) as an unprivileged user, when the Xserver is running as suid-root.
(which today only needed on a few platforms, eg. Solaris). Therefore it's
not suited for being called by arbitrary drivers.

In this specific context it doesn't even much sense, since it's just used
for checking whether pkexec command is present at all (and just should be
used), while the actual exec'ing of the helper is done directly by fork()
and exec() syscalls.

Thus we can safely use standard system() call instead - clearing the road
for dropping System() from Xserver's public/driver API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:18 +02:00
Enrico Weigelt, metux IT consult
08876d7024 tools: fix FTBS on FreeBSD
ETIME seems to be missing, so just alias it to ETIMEDOUT
It's just used by internal functions of the tools.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:18 +02:00
Enrico Weigelt, metux IT consult
d6e228482c sna: stop using obsolete type aliases
The Xserver has been moved to using pixman for all matrix operations, back in
2008, but left some #define's so drivers still compile. Since 1.5 decades have
passed now, it's time to fix remaining drivers still using the old name, so
we can drop these #define's from the Xserver includes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-27 11:44:18 +02:00
Ville Syrjälä
4a64400ec6 sna/video/sprite: Reset colorkey whenever disabling the sprite plane
Let's disable the colorkey whenever we hide the sprite. The colorkey
is a non-standard thing so generic kms clients have no way to disable
it, and the kernel may reject certain otherwise legal things if
colorkeying is left active.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2025-03-21 23:10:23 +02:00
Ville Syrjälä
b45e222e71 sna/video/sprite: Extract sna_video_sprite_hide()
Extract the code that turns off the sprite into a small helper.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2025-03-21 23:09:54 +02:00
Ville Syrjälä
ee0cc334df sna/video/sprite: Plug bo leak
Looks like we're leaking video->bo[index] if the entire
sprite gets clipped. Let's plug that leak.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2025-02-10 19:53:51 +02:00
Ville Syrjälä
8583b09ef6 sna/video/sprite: Use kgem_bo_replace()
Replace the hand rolled bo unref+ref stuff with
kgem_bo_replace().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2025-02-10 19:53:51 +02:00
Ville Syrjälä
7c227f1844 sna/kgem: Add kgem_bo_replace()
Add a helper to do the unref old + ref new bo dance.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2025-02-10 19:53:51 +02:00
Ville Syrjälä
5f3526a16c sna: Don't memcpy() between different types
Currently we're doing a blind memcpy() from a DDXPointRec
into the beginning of a BoxRec. While this apparently works
it's quite dodgy. Get rid of the memcpy() and simply assign
each member by hand.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2025-02-10 19:53:51 +02:00
Ville Syrjälä
fc07603ee0 Fix transposed calloc() arguments
gcc-14 complains:
../src/legacy/i810/i810_dri.c:281:48: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
...

Fix them all up via cocci:
@@
expression E1, E2;
type T;
@@
(
- calloc(sizeof(T), E2)
+ calloc(E2, sizeof(T))
|
- calloc(sizeof(E1), E2)
+ calloc(E2, sizeof(E1))
)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2025-02-10 19:53:46 +02:00
Povilas Kanapickas
e6a4c4740c meson: Add dependency on xv
Symbols such as XvCreateImage, XvPutImage, XvGetPortAttribute come from
libXv.so. Linking to this dependency directly fixes build errors on
Debian Bookworm against xserver 21.1.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2025-02-10 19:04:52 +02:00
Ville Syrjälä
ce811e7888 intel: Fix some theoretical buffer overflow
Looks to me like the theoretical max the sprintf()s need
here is about 34+4+9+sizeof(de->d_name) bytes. Let's just
make that 64+sizeof(de->d_name) for simplicity.

This shuts up the compiler:
../src/intel_device.c: In function ‘__intel_open_device__pci’:
../src/intel_device.c:387:60: warning: ‘%s’ directive writing up to 255 bytes into a region of size 247 [-Wformat-overflow=]
  387 |                         sprintf(path + base + 4, "/dev/dri/%s", de->d_name);
      |                                                            ^~
../src/intel_device.c:387:25: note: ‘sprintf’ output between 10 and 265 bytes into a destination of size 256
  387 |                         sprintf(path + base + 4, "/dev/dri/%s", de->d_name);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/intel_device.c:392:54: warning: ‘/dev’ directive writing 4 bytes into a region of size between 0 and 255 [-Wformat-overflow=]
  392 |                         sprintf(path + base + 3, "/%s/dev", de->d_name);
      |                                                      ^~~~
../src/intel_device.c:392:25: note: ‘sprintf’ output between 6 and 261 bytes into a destination of size 256
  392 |                         sprintf(path + base + 3, "/%s/dev", de->d_name);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2024-05-07 00:32:24 +03:00
Ville Syrjälä
48b093ba65 sna/gen3: Silence compiler warn
../src/sna/kgem_debug_gen3.c:1289:50: warning: ‘%03d’ directive writing between 3 and 10 bytes into a region of size 8 [-Wformat-overflow=]
 1289 |                         sprintf(instr_prefix, "PS%03d", instr);
      |                                                  ^~~~
../src/sna/kgem_debug_gen3.c:1289:47: note: directive argument in the range [0, 1431655764]
 1289 |                         sprintf(instr_prefix, "PS%03d", instr);
      |                                               ^~~~~~~~
../src/sna/kgem_debug_gen3.c:1289:25: note: ‘sprintf’ output between 6 and 13 bytes into a destination of size 10
 1289 |                         sprintf(instr_prefix, "PS%03d", instr);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The compiler is utterly wrong here of course since 'instr'
will at most be (0x1ff + 2 - 1) / 3 ~= 170 (though the hardware
defined max is actually only 123). But let's bump the buffer
size a little bit to shut the compiler up.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2024-05-07 00:32:24 +03:00
Ville Syrjälä
003bca926e sna/gen3: Fix 3DSTATE_PIXEL_SHADER_PROGRAM debugs
3DSTATE_PIXEL_SHADER_PROGRAM instruction length is
9 bits, not 8 bits.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2024-05-07 00:32:24 +03:00
Ville Syrjälä
ea0b9aa5d0 sna/gen2: Silence compiler warn
../src/sna/kgem_debug_gen2.c:625:5: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
  625 |     const static struct {
      |     ^~~~~

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2024-05-07 00:32:24 +03:00
Ville Syrjälä
0750dd02b9 sna: Switch debugs/errors to use crtc index rather than pipe
Let's the limit the use of hardware pipe numbers to absolutely
the only place where it's needed (MI_SCANLINE_WAIT). Everywhere
else just use the crtc index.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2024-05-07 00:32:24 +03:00
Ville Syrjälä
8c67db8739 sna/video: Use crtc index instead of pipe
For consistency with most other code use the kms crtc index
instead of the hardware pipe number where either will do.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2024-05-07 00:32:24 +03:00