linux-stable/Documentation
Maíra Canal c91acda3a3
drm/gem: Check for valid formats
Currently, drm_gem_fb_create() doesn't check if the pixel format is
supported, which can lead to the acceptance of invalid pixel formats
e.g. the acceptance of invalid modifiers. Therefore, add a check for
valid formats on drm_gem_fb_create().

Note that this check is only valid for atomic drivers, because, for
non-atomic drivers, checking drm_any_plane_has_format() is not
possible since the format list for the primary plane is fake, and we'd
therefore reject valid formats.

Adding this check to drm_gem_fb_create() will guarantee that the
igt@kms_addfb_basic@addfb25-bad-modifier IGT test passes for drivers
using this callback.

This commit is a recapture of a series sent a while ago. Initially,
I sent a patch [1] similar to this one in which I introduced the
format check to drm_gem_fb_create().

Based on the feedback on the patch, I placed the check inside
framebuffer_check() [2] so that it wouldn't be needed to hit any
driver-specific code path when the check fails. Therefore, we could
remove the check from the specific drivers (i915, amdgpu, and vmwgfx).

But, with some new feedback, it was shown that introducing this check
inside framebuffer_check() is problematic for the i915 driver [3].
For the i915 driver, in the legacy case, in which we don't get the
modifier from the userspace, i915's fb_create hook computes the right
modifier, which isn't necessarily linear.  Therefore, if we check the
modifier before that point, we might get wrong answers.

So, I kept the check inside the i915 driver and removed the check from
amdgpu and vmwgfx [4]. But, this yet hasn't solved the i915 problem [5].

As we cannot add the check inside framebuffer_check() without
affecting the i915 behavior, this commit went back to the original
patch. This way we can guarantee a more uniform behavior from the
drivers that use the drm_gem_fb_create() callback.

[1] https://lore.kernel.org/dri-devel/20230103125322.855089-1-mcanal@igalia.com/T/
[2] https://lore.kernel.org/dri-devel/20230109105807.18172-1-mcanal@igalia.com/T/
[3] https://lore.kernel.org/dri-devel/Y8AAdW2y7zN7DCUZ@intel.com/
[4] https://lore.kernel.org/dri-devel/20230113112743.188486-1-mcanal@igalia.com/T/
[5] https://lore.kernel.org/dri-devel/Y8FXWvEhO7GCRKVJ@intel.com/

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230412142923.136707-1-mcanal@igalia.com
2023-04-19 20:19:27 -03:00
..
ABI drm/i915/hwmon: Use 0 to designate disabled PL1 power limit 2023-04-03 13:28:49 -04:00
PCI
RCU
accel accel/qaic: Add documentation for AIC100 accelerator driver 2023-04-06 08:23:03 +02:00
accounting
admin-guide A small set of updates for x86: 2023-03-05 11:27:48 -08:00
arc
arm
arm64 arm64 updates for 6.3: 2023-02-21 15:27:48 -08:00
block block: stub out and deprecated the capability attribute on the gendisk 2023-02-06 08:44:55 -07:00
bpf bpf, doc: Link to submitting-patches.rst for general patch submission info 2023-03-06 16:44:39 +01:00
cdrom
core-api - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08:00
cpu-freq
crypto
dev-tools - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08:00
devicetree dt-bindings: display: panel: nt36523: Add Lenovo J606F panel 2023-04-17 17:27:25 +02:00
doc-guide
driver-api Linux 6.3-rc4 2023-03-29 16:00:23 +02:00
fault-injection docs: fault-injection: add requirements of error injectable functions 2023-02-02 22:50:00 -08:00
fb
features
filesystems A handful of fixes and minor documentation updates. 2023-03-14 11:08:28 -07:00
firmware-guide ACPI: docs: enumeration: Correct reference to the I²C device data type 2023-03-07 14:09:49 +01:00
firmware_class
fpga
gpu drm/gem: Check for valid formats 2023-04-19 20:19:27 -03:00
hid It has been a moderately calm cycle for documentation; the significant 2023-02-22 12:00:20 -08:00
hwmon It has been a moderately calm cycle for documentation; the significant 2023-02-22 12:00:20 -08:00
i2c Documentation: i2c: correct spelling 2023-02-15 20:59:44 +01:00
ia64
iio
images
infiniband
input
isdn Documentation: isdn: correct spelling 2023-02-10 16:28:13 -08:00
kbuild Kbuild updates for v6.3 2023-02-26 11:53:25 -08:00
kernel-hacking
leds - Remove Drivers 2023-02-23 15:09:31 -08:00
litmus-tests
livepatch Documentation: livepatch: module-elf-format: Remove local klp_modinfo definition 2023-02-06 08:45:55 -08:00
locking docs: locking: refer to the actual existing config names 2023-02-23 12:26:00 -07:00
loongarch
m68k
maintainer docs: rebasing-and-merging: Drop wrong statement about git 2023-03-07 10:26:22 -07:00
mhi
mips
misc-devices
mm docs/mm: hugetlbfs_reserv: fix a reference to a file that doesn't exist 2023-03-07 10:31:49 -07:00
netlabel
netlink ynl: broaden the license even more 2023-03-16 21:20:32 -07:00
networking xdp: bpf_xdp_metadata use EOPNOTSUPP for no driver support 2023-03-22 09:11:09 -07:00
nios2
nvdimm
nvme
openrisc
parisc
pcmcia
peci
power Power management updates for 6.3-rc1 2023-02-21 12:13:58 -08:00
powerpc
process docs: process: typo fix 2023-03-14 11:31:08 -06:00
riscv Documentation: riscv: fix insufficient list item indent 2023-02-14 16:00:02 -08:00
rust Documentation: rust: Fix arch support table 2023-02-13 10:14:32 +01:00
s390 VFIO updates for v6.3-rc1 2023-02-25 11:52:57 -08:00
scheduler sched/doc: supplement CPU capacity with RISC-V 2023-03-07 10:19:04 -07:00
scsi SCSI misc on 20230222 2023-02-22 13:41:41 -08:00
security
sh
sound It has been a moderately calm cycle for documentation; the significant 2023-02-22 12:00:20 -08:00
sparc Documentation: sparc: correct spelling 2023-02-02 11:07:02 -07:00
sphinx docs: Use HTML comments for the kernel-toc SPDX line 2023-02-16 16:06:44 -07:00
sphinx-static docs: Add more information to the HTML sidebar 2023-02-08 13:28:27 -07:00
spi
staging
target scsi: target: Documentation: Correct spelling 2023-02-08 18:49:48 -05:00
timers
tools Documentation/rtla: Add hwnoise man page 2023-02-13 23:56:46 -05:00
trace Char/Misc and other driver subsystem changes for 6.3-rc1 2023-02-24 12:47:33 -08:00
translations docs/mm: hugetlbfs_reserv: fix a reference to a file that doesn't exist 2023-03-07 10:31:49 -07:00
usb docs: usb: Add documentation for the UVC Gadget 2023-03-09 15:18:33 +01:00
userspace-api ynl: broaden the license even more 2023-03-16 21:20:32 -07:00
virt ARM: 2023-02-25 11:30:21 -08:00
w1
watchdog Documentation/watchdog/hpwdt: Fix Format 2023-02-16 17:31:29 -07:00
x86 It has been a moderately calm cycle for documentation; the significant 2023-02-22 12:00:20 -08:00
xtensa
.gitignore
Changes
CodingStyle
Kconfig
Makefile
SubmittingPatches
arch.rst
atomic_bitops.txt
atomic_t.txt
conf.py It has been a moderately calm cycle for documentation; the significant 2023-02-22 12:00:20 -08:00
docutils.conf
dontdiff
index.rst Documentation: front page: use recommended heading adornments 2023-02-23 12:44:51 -07:00
memory-barriers.txt
subsystem-apis.rst