linux/drivers/staging
Andrzej Pietrasiewicz 85bdcb7eaa media: hantro: Write the quantization tables in proper order
The quantization tables as defined in the file (luma_q_table,
chroma_q_table) are in fact in linear order. The JPEG file header, which is
not generated by the hardware, but must be programatically created with the
CPU, expects the table in zigzag order. On the other hand, the hardware
doesn't expect neither linear, nor zigzag order. Instead it expects the
quantization tables in vertical groups of four quantization parameters,
and the groups are organized in blocks of two vertically adjacent groups.
On top of that the blocks must be provided to the hardware in this order:
leftmost top block, leftmost bottom block, second leftmost top block,
second leftmost bottom block and so on. So, if this is the quantization
table in linear order:

0x10, 0x0b, 0x0a, 0x10, 0x18, 0x28, 0x33, 0x3d,
0x0c, 0x0c, 0x0e, 0x13, 0x1a, 0x3a, 0x3c, 0x37,
0x0e, 0x0d, 0x10, 0x18, 0x28, 0x39, 0x45, 0x38,
0x0e, 0x11, 0x16, 0x1d, 0x33, 0x57, 0x50, 0x3e,
0x12, 0x16, 0x25, 0x38, 0x44, 0x6d, 0x67, 0x4d,
0x18, 0x23, 0x37, 0x40, 0x51, 0x68, 0x71, 0x5c,
0x31, 0x40, 0x4e, 0x57, 0x67, 0x79, 0x78, 0x65,
0x48, 0x5c, 0x5f, 0x62, 0x70, 0x64, 0x67, 0x63

then the hardware expects this in its consecutive registers:

0x100c0e0e,
0x0b0c0d11,
0x12183148,
0x1623405c,
0x0a0e1016,
0x1013181d,
0x25374e5f,
0x38405762,

and so on.

Consequently, the same area of memory cannot be used both for dumping it
into the JPEG file header and writing its contents to the hardware
registers. Instead, a separate pair of arrays is added for properly
reordered quantization tables, to be read with get_unaligned_be32()
and linearly written to the registers.

The "ctx" parameter is not needed any more for hantro_jpeg_get_qtable().

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Tested-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-02-24 17:19:32 +01:00
..
android drm pull for 5.6-rc1 2020-01-30 08:04:01 -08:00
axis-fifo staging: axis-fifo: replace spinlock with mutex 2020-01-22 09:58:01 +01:00
board staging: board: use appropriate macro to initialize struct 2019-09-30 21:57:57 +02:00
clocking-wizard staging: clocking-wizard: use devm_platform_ioremap_resource() to simplify code 2019-10-10 11:00:59 +02:00
comedi staging: comedi: drivers: fix spelling mistake "to" -> "too" 2020-01-23 19:16:13 +01:00
emxx_udc staging: emxx_udc: Fix invalid reference error 2019-10-30 10:38:46 +01:00
exfat staging: exfat: remove fs_func struct. 2020-01-23 19:16:13 +01:00
fbtft fbtft: Fix the initialization from property algorithm 2019-12-10 15:55:55 +01:00
fieldbus staging: fieldbus: anybuss: use devm_platform_ioremap_resource helper 2019-10-27 08:15:43 +01:00
fsl-dpaa2 staging: dpaa2-ethsw: ordered workqueue should be per ethsw 2019-11-13 00:10:16 +01:00
fwserial staging: fwserial: Fix Kconfig indentation (seven spaces) 2019-11-22 11:32:54 +01:00
gasket remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
gdm724x
goldfish
greybus
gs_fpgaboot
hp Merge 5.5-rc2 into staging-next 2019-12-16 09:06:50 +01:00
iio iio: adis: Remove startup_delay 2020-01-12 11:34:13 +00:00
kpc2000 Staging/IIO patches for 5.6-rc1 2020-01-29 10:15:11 -08:00
ks7010 netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
media media: hantro: Write the quantization tables in proper order 2020-02-24 17:19:32 +01:00
most media: staging/most: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:52:59 +01:00
mt7621-dma staging: mt7621-dma: align to match open parenthesis 2019-11-07 16:14:10 +01:00
mt7621-dts staging: mt7621-dts: fix register range of memc node in mt7621.dtsi 2020-01-10 13:49:18 +01:00
mt7621-pci MIPS: ralink: enable PCI support only if driver for mt7621 SoC is selected 2019-11-14 13:09:37 +08:00
mt7621-pci-phy
mt7621-pinctrl
netlogic Staging: Netlogic: Fix spelling mistake 2019-10-24 23:08:32 -04:00
nvec staging: nvec: check return value 2019-12-19 19:23:29 +01:00
olpc_dcon staging: olpc_dcon: fix wrong dependencies in Kconfig file 2019-09-30 21:58:00 +02:00
pi433 compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
qlge Staging/IIO patches for 5.6-rc1 2020-01-29 10:15:11 -08:00
ralink-gdma staging: ralink-gdma: use devm_platform_ioremap_resource() to simplify code 2019-10-24 22:40:38 -04:00
rtl8188eu staging: rtl8188eu: remove unused enum and defines 2020-01-22 09:44:44 +01:00
rtl8192e Staging/IIO patches for 5.6-rc1 2020-01-29 10:15:11 -08:00
rtl8192u proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
rtl8712 staging: rtl8712: simplify evm_db2percentage() 2020-01-22 09:44:45 +01:00
rtl8723bs staging: rtl8723bs: remove ODM_GetRightChnlPlaceforIQK() 2020-01-14 14:56:37 +01:00
rts5208 Staging/IIO patches for 5.6-rc1 2020-01-29 10:15:11 -08:00
sm750fb remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
speakup staging: speakup: document sysfs attributes 2019-10-04 10:06:05 +02:00
unisys netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
uwb remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
vc04_services media: bcm2835-camera: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:52:49 +01:00
vme compat_ioctl: move more drivers to compat_ptr_ioctl 2019-10-23 17:23:44 +02:00
vt6655 staging: vt6655: remove redundant assignment to variable ret 2020-01-15 13:11:41 +01:00
vt6656 staging: vt6656: Remove memory buffer from vnt_download_firmware. 2020-01-22 09:52:39 +01:00
wfx staging: wfx: update TODO 2020-01-16 20:59:54 +01:00
wilc1000 staging: wilc1000: avoid mutex unlock without lock in wilc_wlan_handle_txq() 2020-01-23 19:16:12 +01:00
wlan-ng Staging/IIO patches for 5.6-rc1 2020-01-29 10:15:11 -08:00
wusbcore
Kconfig staging: octeon-usb: delete the octeon usb host controller driver 2019-12-17 12:54:55 +01:00
Makefile staging: exfat: add STAGING prefix to config names 2020-01-03 11:04:58 +01:00