Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixel artefacts with vc4-kms-v3d on 7'' screen #99

Open
soswow opened this issue May 25, 2017 · 2 comments
Open

Pixel artefacts with vc4-kms-v3d on 7'' screen #99

soswow opened this issue May 25, 2017 · 2 comments

Comments

@soswow
Copy link

soswow commented May 25, 2017

Raspberry Pi 3. + Official screen 7''.
I've downloaded latest raspbian, did all the required things like apt-get update, upgrade etc.
(UPDATE: And I am sure I've enabled something that I've shouldn't have.)

img_20170525_205241
img_20170525_205258
img_20170525_205317

$ uname -a
Linux raspberrypi3 4.9.29-v7+ #1000 SMP Sun May 21 20:11:31 BST 2017 armv7l GNU/Linux
$ dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.29-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #1000 SMP Sun May 21 20:11:31 BST 2017
[    0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt:Machine model: Raspberry Pi 3 Model B Rev 1.2
[    0.000000] cma: Reserved 256 MiB at 0x1ec00000
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 194048
[    0.000000] free_area_init_node: node 0, pgdat 80c6ee00, node_mem_map 9e552000
[    0.000000]   Normal zone: 1706 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 194048 pages, LIFO batch:31
[    0.000000] percpu: Embedded 14 pages/cpu @af533000 s25600 r8192 d23552 u57344
[    0.000000] pcpu-alloc: s25600 r8192 d23552 u57344 alloc=14*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 192342
[    0.000000] Kernel command line: 8250.nr_uarts=0 cma=256M bcm2708_fb.fbwidth=800 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=9577b1c2-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 493040K/776192K available (7168K kernel code, 483K rwdata, 2012K rodata, 1024K init, 778K bss, 21008K reserved, 262144K cma-reserved)
[    0.000000] Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xaf800000 - 0xff800000   (1280 MB)
    lowmem  : 0x80000000 - 0xaf600000   ( 758 MB)
    modules : 0x7f000000 - 0x80000000   (  16 MB)
      .text : 0x80008000 - 0x80800000   (8160 kB)
      .init : 0x80b00000 - 0x80c00000   (1024 kB)
      .data : 0x80c00000 - 0x80c78fd4   ( 484 kB)
       .bss : 0x80c7a000 - 0x80d3ca64   ( 779 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] 	Build-time adjustment of leaf fanout to 32.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 19.20MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000009] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000025] Switching to timer-based delay loop, resolution 52ns
[    0.000335] Console: colour dummy device 80x30
[    0.001241] console [tty1] enabled
[    0.001289] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.001360] pid_max: default: 32768 minimum: 301
[    0.001723] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.001766] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.002781] Disabling cpuset control group subsystem
[    0.002969] CPU: Testing write buffer coherency: ok
[    0.003039] ftrace: allocating 22386 entries in 66 pages
[    0.055540] CPU0: update cpu_capacity 1024
[    0.055605] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.055706] Setting up static identity map for 0x100000 - 0x100034
[    0.057942] CPU1: update cpu_capacity 1024
[    0.057950] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.058674] CPU2: update cpu_capacity 1024
[    0.058681] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.059349] CPU3: update cpu_capacity 1024
[    0.059355] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.059438] Brought up 4 CPUs
[    0.059610] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.059640] CPU: All CPU(s) started in HYP mode.
[    0.059666] CPU: Virtualization extensions available.
[    0.060459] devtmpfs: initialized
[    0.071727] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[    0.072048] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.072111] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.082664] pinctrl core: initialized pinctrl subsystem
[    0.083683] NET: Registered protocol family 16
[    0.086044] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.094888] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.094937] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.095135] Serial: AMBA PL011 UART driver
[    0.097433] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.097989] uart-pl011 3f201000.serial: could not find pctldev for node /soc/gpio@7e200000/uart0_pins, deferring probe
[    0.166220] bcm2835-dma 3f007000.dma: DMA legacy API manager at af80f000, dmachans=0x1
[    0.168161] SCSI subsystem initialized
[    0.168341] usbcore: registered new interface driver usbfs
[    0.168446] usbcore: registered new interface driver hub
[    0.168563] usbcore: registered new device driver usb
[    0.175161] raspberrypi-firmware soc:firmware: Attached to firmware from 2017-05-15 17:01
[    0.176600] clocksource: Switched to clocksource arch_sys_counter
[    0.223395] VFS: Disk quotas dquot_6.6.0
[    0.223506] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.223743] FS-Cache: Loaded
[    0.224020] CacheFiles: Loaded
[    0.236138] NET: Registered protocol family 2
[    0.237068] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.237206] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    0.237417] TCP: Hash tables configured (established 8192 bind 8192)
[    0.237535] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.237603] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.237837] NET: Registered protocol family 1
[    0.238266] RPC: Registered named UNIX socket transport module.
[    0.238298] RPC: Registered udp transport module.
[    0.238326] RPC: Registered tcp transport module.
[    0.238354] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.239428] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available
[    0.241796] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[    0.257841] FS-Cache: Netfs 'nfs' registered for caching
[    0.258816] NFS: Registering the id_resolver key type
[    0.258866] Key type id_resolver registered
[    0.258895] Key type id_legacy registered
[    0.261144] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.261290] io scheduler noop registered
[    0.261321] io scheduler deadline registered (default)
[    0.261601] io scheduler cfq registered
[    0.269506] bcm2835-rng 3f104000.rng: hwrng registered
[    0.269687] vc-cma: Videocore CMA driver
[    0.269716] vc-cma: vc_cma_base      = 0x00000000
[    0.269745] vc-cma: vc_cma_size      = 0x00000000 (0 MiB)
[    0.269774] vc-cma: vc_cma_initial   = 0x00000000 (0 MiB)
[    0.269995] vc-mem: phys_addr:0x00000000 mem_base=0x3dc00000 mem_size:0x3f000000(1008 MiB)
[    0.285057] brd: module loaded
[    0.293929] loop: module loaded
[    0.293971] Loading iSCSI transport class v2.0-870.
[    0.294500] usbcore: registered new interface driver smsc95xx
[    0.294541] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    0.520631] Core Release: 2.80a
[    0.520663] Setting default values for core params
[    0.520716] Finished setting default values for core params
[    0.721127] Using Buffer DMA mode
[    0.721156] Periodic Transfer Interrupt Enhancement - disabled
[    0.721186] Multiprocessor Interrupt Enhancement - disabled
[    0.721216] OTG VER PARAM: 0, OTG VER FLAG: 0
[    0.721248] Dedicated Tx FIFOs mode
[    0.721602] WARN::dwc_otg_hcd_init:1034: FIQ DMA bounce buffers: virt = 0x9ed04000 dma = 0xded04000 len=9024
[    0.721670] FIQ FSM acceleration enabled for :
Non-periodic Split Transactions
Periodic Split Transactions
High-Speed Isochronous Endpoints
Interrupt/Control Split Transaction hack enabled
[    0.721783] dwc_otg: Microframe scheduler enabled
[    0.721824] WARN::hcd_init_fiq:459: FIQ on core 1 at 0x8058e610
[    0.721859] WARN::hcd_init_fiq:460: FIQ ASM at 0x8058e980 length 36
[    0.721895] WARN::hcd_init_fiq:486: MPHI regs_base at 0xaf8a7000
[    0.721975] dwc_otg 3f980000.usb: DWC OTG Controller
[    0.722031] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    0.722101] dwc_otg 3f980000.usb: irq 62, io mem 0x00000000
[    0.722171] Init: Port Power? op_state=1
[    0.722197] Init: Power Port (0)
[    0.722418] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    0.722455] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.722503] usb usb1: Product: DWC OTG Controller
[    0.722534] usb usb1: Manufacturer: Linux 4.9.29-v7+ dwc_otg_hcd
[    0.722566] usb usb1: SerialNumber: 3f980000.usb
[    0.723309] hub 1-0:1.0: USB hub found
[    0.723377] hub 1-0:1.0: 1 port detected
[    0.724015] dwc_otg: FIQ enabled
[    0.724020] dwc_otg: NAK holdoff enabled
[    0.724024] dwc_otg: FIQ split-transaction FSM enabled
[    0.724037] Module dwc_common_port init
[    0.724256] usbcore: registered new interface driver usb-storage
[    0.724511] mousedev: PS/2 mouse device common for all mice
[    0.725522] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
[    0.725843] bcm2835-cpufreq: min=600000 max=1200000
[    0.726295] sdhci: Secure Digital Host Controller Interface driver
[    0.726326] sdhci: Copyright(c) Pierre Ossman
[    0.726694] sdhost-bcm2835 3f202000.sdhost: could not get clk, deferring probe
[    0.728936] mmc-bcm2835 3f300000.mmc: could not get clk, deferring probe
[    0.729064] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.736386] ledtrig-cpu: registered to indicate activity on CPUs
[    0.736634] hidraw: raw HID events driver (C) Jiri Kosina
[    0.736839] usbcore: registered new interface driver usbhid
[    0.736869] usbhid: USB HID core driver
[    0.737672] vchiq: vchiq_init_state: slot_zero = 0x9ed80000, is_master = 0
[    0.744223] Initializing XFRM netlink socket
[    0.744270] NET: Registered protocol family 17
[    0.744404] Key type dns_resolver registered
[    0.744825] Registering SWP/SWPB emulation handler
[    0.745572] registered taskstats version 1
[    0.745919] vc-sm: Videocore shared memory driver
[    0.745953] [vc_sm_connected_init]: start
[    0.750737] [vc_sm_connected_init]: end - returning 0
[    0.756759] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[    0.758309] sdhost: log_buf @ 9ed07000 (ded07000)
[    0.836624] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    0.838858] mmc-bcm2835 3f300000.mmc: mmc_debug:0 mmc_debug2:0
[    0.838894] mmc-bcm2835 3f300000.mmc: DMA channel allocated
[    0.904392] mmc0: host does not support reading read-only switch, assuming write-enable
[    0.906385] mmc0: new high speed SDHC card at address 1234
[    0.907051] mmcblk0: mmc0:1234 SA16G 14.4 GiB
[    0.908695]  mmcblk0: p1 p2
[    0.916758] of_cfs_init
[    0.916855] of_cfs_init: OK
[    0.923745] EXT4-fs (mmcblk0p2): INFO: recovery required on readonly filesystem
[    0.923796] EXT4-fs (mmcblk0p2): write access will be enabled during recovery
[    0.933043] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    0.934622] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    0.936195] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    0.936739] Indeed it is in host mode hprt0 = 00021501
[    0.999014] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    1.009169] random: fast init done
[    1.090485] mmc1: new high speed SDIO card at address 0001
[    1.136662] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    1.136833] Indeed it is in host mode hprt0 = 00001101
[    1.366885] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[    1.366924] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.367710] hub 1-1:1.0: USB hub found
[    1.367815] hub 1-1:1.0: 5 ports detected
[    1.686629] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    1.816868] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    1.816908] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.819684] smsc95xx v1.0.5
[    1.910301] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:55:0e:00
[    4.713148] EXT4-fs (mmcblk0p2): orphan cleanup on readonly fs
[    4.713495] EXT4-fs (mmcblk0p2): 1 orphan inode deleted
[    4.713529] EXT4-fs (mmcblk0p2): recovery complete
[    5.866490] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    5.866585] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    5.877327] devtmpfs: mounted
[    5.879104] Freeing unused kernel memory: 1024K (80b00000 - 80c00000)
[    6.162183] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
[    6.162583] systemd[1]: Detected architecture 'arm'.
[    6.272044] NET: Registered protocol family 10
[    6.273562] systemd[1]: Inserted module 'ipv6'
[    6.276027] systemd[1]: Set hostname to <raspberrypi3>.
[    6.276263] systemd[1]: Initializing machine ID from random generator.
[    6.276497] systemd[1]: Installed transient /etc/machine-id file.
[    6.640995] systemd[1]: Cannot add dependency job for unit regenerate_ssh_host_keys.service, ignoring: Unit regenerate_ssh_host_keys.service failed to load: No such file or directory.
[    6.644258] systemd[1]: Starting Forward Password Requests to Wall Directory Watch.
[    6.644637] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    6.644751] systemd[1]: Starting Remote File Systems (Pre).
[    6.828353] fuse init (API version 7.26)
[    6.862608] i2c /dev entries driver
[    6.987960] systemd-udevd[137]: starting version 215
[    7.449061] rpi-ft5406 rpi_ft5406: Probing device
[    7.449834] input: FT5406 memory based driver as /devices/virtual/input/input0
[    7.462128] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    7.582099] i2c-gpio soc:i2cdsi: using pins 44 (SDA) and 45 (SCL)
[    7.706539] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    7.827172] [drm] Initialized
[    7.932588] vc4_hdmi 3f902000.hdmi: vc4-hdmi-hifi <-> 3f902000.hdmi mapping ok
[    7.934660] vc4-drm soc:gpu: bound 3f902000.hdmi (ops vc4_hdmi_ops [vc4])
[    7.934903] vc4-drm soc:gpu: bound 3f806000.vec (ops vc4_vec_ops [vc4])
[    7.936797] vc4-drm soc:gpu: bound 3f700000.dsi (ops vc4_dsi_ops [vc4])
[    7.936927] vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])
[    7.937203] vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops vc4_crtc_ops [vc4])
[    7.937394] vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops vc4_crtc_ops [vc4])
[    7.938371] usbcore: registered new interface driver brcmfmac
[    7.939315] vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops vc4_crtc_ops [vc4])
[    7.965645] vc4-drm soc:gpu: bound 3fc00000.v3d (ops vc4_v3d_ops [vc4])
[    7.967327] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    7.967335] [drm] Driver supports precise vblank timestamp query.
[    7.989770] Console: switching to colour frame buffer device 90x30
[    7.997436] vc4-drm soc:gpu: fb0:  frame buffer device
[    8.122119] brcmfmac: Firmware version = wl0: May 27 2016 00:13:38 version 7.45.41.26 (r640327) FWID 01-df77e4a7
[    8.605560] systemd-journald[141]: Received request to flush runtime journal from PID 1
[    9.346182] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[    9.346231] brcmfmac: power management disabled
[    9.980114] uart-pl011 3f201000.serial: no DMA platform data
[   10.069238] Adding 102396k swap on /var/swap.  Priority:-1 extents:5 across:225280k SSFS
[   10.434024] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   10.828921] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   10.829502] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   14.414357] Bluetooth: Core ver 2.22
[   14.414405] NET: Registered protocol family 31
[   14.414408] Bluetooth: HCI device and connection manager initialized
[   14.414773] Bluetooth: HCI socket layer initialized
[   14.414781] Bluetooth: L2CAP socket layer initialized
[   14.414798] Bluetooth: SCO socket layer initialized
[   14.421250] Bluetooth: HCI UART driver ver 2.3
[   14.421258] Bluetooth: HCI UART protocol H4 registered
[   14.421260] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   14.421378] Bluetooth: HCI UART protocol Broadcom registered
[   14.556476] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   14.556483] Bluetooth: BNEP filters: protocol multicast
[   14.556494] Bluetooth: BNEP socket layer initialized
[   14.626699] vc4_dsi 3f700000.dsi: Timeout waiting for DSI STOP entry: STAT 0x00020003
[   22.759895] vc4_hdmi 3f902000.hdmi: ASoC: can't open interface 3f902000.hdmi: -19
[   22.760294] vc4_hdmi 3f902000.hdmi: ASoC: can't open interface 3f902000.hdmi: -19
[   58.478321] random: crng init done
$ cat /boot/config.txt
# For more options and information see
# http://rpf.io/configtxtreadme
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=0

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=800
#framebuffer_height=480

# uncomment if hdmi display is not detected and composite is being output
# Was commented out ny default
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
# There was no this line by default
# hdmi_cvt=800 480 60
#hdmi_cvt 800 480 60 6 0 0 0
# This was commented out by default
#hdmi_group=2
# This was commented out and had value 9
#hdmi_mode=87

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
# config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on
start_x=1
gpu_mem=250
dtoverlay=vc4-kms-v3d

# Official Rapsberry Pi display touchscreen
dtoverlay=rpi-ft5406

# Raspberry Pi official display backlight driver
dtoverlay=rpi-backlight
@soswow
Copy link
Author

soswow commented May 25, 2017

Changing dtoverlay=vc4-kms-v3d to dtoverlay=vc4-fkms-v3dhelped.

@soswow soswow changed the title 7'' Raspberry display resolution automatically sets to 720x480 and screen have artifacts Pixel artefacts with vc4-kms-v3d on 7'' screen May 26, 2017
@anholt
Copy link
Owner

anholt commented Jun 1, 2017

I've seen similar artifacts, and have done a bunch of debug but not come up with anything yet.

stschake pushed a commit to stschake/linux that referenced this issue Apr 11, 2018
syzkaller reported a crash in ata_bmdma_fill_sg() when writing to
/dev/sg1.  The immediate cause was that the ATA command's scatterlist
was not DMA-mapped, which causes 'pi - 1' to underflow, resulting in a
write to 'qc->ap->bmdma_prd[0xffffffff]'.

Strangely though, the flag ATA_QCFLAG_DMAMAP was set in qc->flags.  The
root cause is that when __ata_scsi_queuecmd() is preparing to relay a
SCSI command to an ATAPI device, it doesn't correctly validate the CDB
length before copying it into the 16-byte buffer 'cdb' in 'struct
ata_queued_cmd'.  Namely, it validates the fixed CDB length expected
based on the SCSI opcode but not the actual CDB length, which can be
larger due to the use of the SG_NEXT_CMD_LEN ioctl.  Since 'flags' is
the next member in ata_queued_cmd, a buffer overflow corrupts it.

Fix it by requiring that the actual CDB length be <= 16 (ATAPI_CDB_LEN).

[Really it seems the length should be required to be <= dev->cdb_len,
but the current behavior seems to have been intentionally introduced by
commit 607126c ("libata-scsi: be tolerant of 12-byte ATAPI commands
in 16-byte CDBs") to work around a userspace bug in mplayer.  Probably
the workaround is no longer needed (mplayer was fixed in 2007), but
continuing to allow lengths to up 16 appears harmless for now.]

Here's a reproducer that works in QEMU when /dev/sg1 refers to the
CD-ROM drive that qemu-system-x86_64 creates by default:

    #include <fcntl.h>
    #include <sys/ioctl.h>
    #include <unistd.h>

    #define SG_NEXT_CMD_LEN 0x2283

    int main()
    {
	    char buf[53] = { [36] = 0x7e, [52] = 0x02 };
	    int fd = open("/dev/sg1", O_RDWR);
	    ioctl(fd, SG_NEXT_CMD_LEN, &(int){ 17 });
	    write(fd, buf, sizeof(buf));
    }

The crash was:

    BUG: unable to handle kernel paging request at ffff8cb97db37ffc
    IP: ata_bmdma_fill_sg drivers/ata/libata-sff.c:2623 [inline]
    IP: ata_bmdma_qc_prep+0xa4/0xc0 drivers/ata/libata-sff.c:2727
    PGD fb6c067 P4D fb6c067 PUD 0
    Oops: 0002 [anholt#1] SMP
    CPU: 1 PID: 150 Comm: syz_ata_bmdma_q Not tainted 4.15.0-next-20180202 anholt#99
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-20171110_100015-anatol 04/01/2014
    [...]
    Call Trace:
     ata_qc_issue+0x100/0x1d0 drivers/ata/libata-core.c:5421
     ata_scsi_translate+0xc9/0x1a0 drivers/ata/libata-scsi.c:2024
     __ata_scsi_queuecmd drivers/ata/libata-scsi.c:4326 [inline]
     ata_scsi_queuecmd+0x8c/0x210 drivers/ata/libata-scsi.c:4375
     scsi_dispatch_cmd+0xa2/0xe0 drivers/scsi/scsi_lib.c:1727
     scsi_request_fn+0x24c/0x530 drivers/scsi/scsi_lib.c:1865
     __blk_run_queue_uncond block/blk-core.c:412 [inline]
     __blk_run_queue+0x3a/0x60 block/blk-core.c:432
     blk_execute_rq_nowait+0x93/0xc0 block/blk-exec.c:78
     sg_common_write.isra.7+0x272/0x5a0 drivers/scsi/sg.c:806
     sg_write+0x1ef/0x340 drivers/scsi/sg.c:677
     __vfs_write+0x31/0x160 fs/read_write.c:480
     vfs_write+0xa7/0x160 fs/read_write.c:544
     SYSC_write fs/read_write.c:589 [inline]
     SyS_write+0x4d/0xc0 fs/read_write.c:581
     do_syscall_64+0x5e/0x110 arch/x86/entry/common.c:287
     entry_SYSCALL_64_after_hwframe+0x21/0x86

Fixes: 607126c ("libata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs")
Reported-by: syzbot+1ff6f9fcc3c35f1c72a95e26528c8e7e3276e4da@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org> # v2.6.24+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
anholt pushed a commit that referenced this issue Apr 17, 2018
commit 058f58e upstream.

syzkaller reported a crash in ata_bmdma_fill_sg() when writing to
/dev/sg1.  The immediate cause was that the ATA command's scatterlist
was not DMA-mapped, which causes 'pi - 1' to underflow, resulting in a
write to 'qc->ap->bmdma_prd[0xffffffff]'.

Strangely though, the flag ATA_QCFLAG_DMAMAP was set in qc->flags.  The
root cause is that when __ata_scsi_queuecmd() is preparing to relay a
SCSI command to an ATAPI device, it doesn't correctly validate the CDB
length before copying it into the 16-byte buffer 'cdb' in 'struct
ata_queued_cmd'.  Namely, it validates the fixed CDB length expected
based on the SCSI opcode but not the actual CDB length, which can be
larger due to the use of the SG_NEXT_CMD_LEN ioctl.  Since 'flags' is
the next member in ata_queued_cmd, a buffer overflow corrupts it.

Fix it by requiring that the actual CDB length be <= 16 (ATAPI_CDB_LEN).

[Really it seems the length should be required to be <= dev->cdb_len,
but the current behavior seems to have been intentionally introduced by
commit 607126c ("libata-scsi: be tolerant of 12-byte ATAPI commands
in 16-byte CDBs") to work around a userspace bug in mplayer.  Probably
the workaround is no longer needed (mplayer was fixed in 2007), but
continuing to allow lengths to up 16 appears harmless for now.]

Here's a reproducer that works in QEMU when /dev/sg1 refers to the
CD-ROM drive that qemu-system-x86_64 creates by default:

    #include <fcntl.h>
    #include <sys/ioctl.h>
    #include <unistd.h>

    #define SG_NEXT_CMD_LEN 0x2283

    int main()
    {
	    char buf[53] = { [36] = 0x7e, [52] = 0x02 };
	    int fd = open("/dev/sg1", O_RDWR);
	    ioctl(fd, SG_NEXT_CMD_LEN, &(int){ 17 });
	    write(fd, buf, sizeof(buf));
    }

The crash was:

    BUG: unable to handle kernel paging request at ffff8cb97db37ffc
    IP: ata_bmdma_fill_sg drivers/ata/libata-sff.c:2623 [inline]
    IP: ata_bmdma_qc_prep+0xa4/0xc0 drivers/ata/libata-sff.c:2727
    PGD fb6c067 P4D fb6c067 PUD 0
    Oops: 0002 [#1] SMP
    CPU: 1 PID: 150 Comm: syz_ata_bmdma_q Not tainted 4.15.0-next-20180202 #99
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-20171110_100015-anatol 04/01/2014
    [...]
    Call Trace:
     ata_qc_issue+0x100/0x1d0 drivers/ata/libata-core.c:5421
     ata_scsi_translate+0xc9/0x1a0 drivers/ata/libata-scsi.c:2024
     __ata_scsi_queuecmd drivers/ata/libata-scsi.c:4326 [inline]
     ata_scsi_queuecmd+0x8c/0x210 drivers/ata/libata-scsi.c:4375
     scsi_dispatch_cmd+0xa2/0xe0 drivers/scsi/scsi_lib.c:1727
     scsi_request_fn+0x24c/0x530 drivers/scsi/scsi_lib.c:1865
     __blk_run_queue_uncond block/blk-core.c:412 [inline]
     __blk_run_queue+0x3a/0x60 block/blk-core.c:432
     blk_execute_rq_nowait+0x93/0xc0 block/blk-exec.c:78
     sg_common_write.isra.7+0x272/0x5a0 drivers/scsi/sg.c:806
     sg_write+0x1ef/0x340 drivers/scsi/sg.c:677
     __vfs_write+0x31/0x160 fs/read_write.c:480
     vfs_write+0xa7/0x160 fs/read_write.c:544
     SYSC_write fs/read_write.c:589 [inline]
     SyS_write+0x4d/0xc0 fs/read_write.c:581
     do_syscall_64+0x5e/0x110 arch/x86/entry/common.c:287
     entry_SYSCALL_64_after_hwframe+0x21/0x86

Fixes: 607126c ("libata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs")
Reported-by: syzbot+1ff6f9fcc3c35f1c72a95e26528c8e7e3276e4da@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org> # v2.6.24+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants