~joe-yasi/xserver-xorg-video-intel/+git/xf86-video-intel:master

Last commit made on 2024-05-06
Get this branch:
git clone -b master https://git.launchpad.net/~joe-yasi/xserver-xorg-video-intel/+git/xf86-video-intel

Branch merges

Branch information

Recent commits

ce811e7... by =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= <email address hidden>

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ä <email address hidden>

48b093b... by =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= <email address hidden>

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ä <email address hidden>

003bca9... by =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= <email address hidden>

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ä <email address hidden>

ea0b9aa... by =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= <email address hidden>

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ä <email address hidden>

0750dd0... by =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= <email address hidden>

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ä <email address hidden>

8c67db8... by =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= <email address hidden>

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ä <email address hidden>

86ba5af... by =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= <email address hidden>

sna: Switch to using crtc index instead of pipe

Start using the kms crtc index rather than the pipe almost
everywhere. The two numbers could in theory be different
if the hardware has some pipes fused off. Though I think
such non-contiguous fusing won't actually happen on the
hardware generations the driver fully supports.

The places where we must use the kms crtc indexes are
eg. vblank ioctl crtc selection bits, and checks
against in encoder possible_crtcs bitmask.

The only place where we must stick to the hardware pipe
indexing is the MI_SCANLINE_WAIT stuff as there we have to
construct CS packets to be consumed by the hardware itself.

Signed-off-by: Ville Syrjälä <email address hidden>

fdf78ae... by =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= <email address hidden>

uxa: Switch to using crtc index instead of pipe

Start using the kms crtc index rather than the pipe almost
everywhere. The two numbers could in theory be different
if the hardware has some pipes fused off. Though I think
such non-contiguous fusing won't actually happen on the
hardware generations the driver fully supports.

The places where using the kms crtc index is the correct
choice have to do with the vblank ioctl crtc selection.

The only place where we must stick to the hardware pipe
indexing is the MI_SCANLINE_WAIT stuff as there we have to
construct CS packets to be consumed by the hardware itself.

Signed-off-by: Ville Syrjälä <email address hidden>

b74b67f... by =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= <email address hidden>

sna: Shut up enum warns

The libdrm enum usage is a mess, and modern gcc is unhappy about
the implicit conversions:
../src/sna/sna_present.c:229:26: warning: implicit conversion from ‘enum <anonymous>’ to ‘enum drm_vblank_seq_type’ [-Wenum-conversion]

Just cast to an integer type to silence the warns.

Signed-off-by: Ville Syrjälä <email address hidden>

1b69012... by =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= <email address hidden>

sna: Don't redefine NV12 stuff if already defined

Modern server headers already define NV12 for us. Avoid the
redefine.

Signed-off-by: Ville Syrjälä <email address hidden>