drm/imx: ipu-v3 fixups and grayscale support

- Make const interrupt register arrays static, reduces object size.
 - Fix device_node leaks in PRE/PRG phandle lookup functions.
 - Add 8-bit and 16-bit grayscale buffer support to ipu_cpmem_set_image,
 - add 10-bit and 12-bit grayscale media bus support to ipu-csi,
   to be used by the imx-media driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCAA1FiEEBsBxhV1FaKwXuCOBUMKIHHCeYOsFAlqOoq4XHHAuemFiZWxA
 cGVuZ3V0cm9uaXguZGUACgkQUMKIHHCeYOtpGRAAhSTtPcH3lgeAqMk6uDexmPYO
 HaNPfcKpg1IS+MBTphnZH09ZGhGBRoEsYxuU2Ms5rpqhhc6zBI1CBMSNS+OOwOh0
 8/oaH3LkD/qIw9G5mmzbj5v5GjL5IX/gIBUG4xWlknlNPF3alqrtnOUmA2ATJu60
 Z5Lgn7JyDn4HGCkQDxC+1PisRi8HBm3L5Lhe2KYTImLBCy0i9PaeyTbpBs+J+0i7
 o9F8Y9NP2MtKv+6gHHnI/fpKPIhoHFm7IbIh4h09rgwTbT7PikYid0RjY1b/onfD
 qNhS1+nPsWB+c2uGrOqYjZ8+aA6Q7gO/SZhFhJBay8teUs0d7kyRw/uPK4waxqjU
 c9CJsuhxsGoz1+rrEOnV15kQIZ0zYD1ESJUFROabougUFMKP7gvlmeRQ2ie4Tdnm
 4gCa1zZPBau2QGaOcHNEGgcu7bWCRbl2dJOYEDXHZnAB7Ee68gXYMQp38mXIe3OS
 Pcj4+d7+nGDpX1YM/V9hA9+1lCZ/xTcFe6zv55/Ox5qEsYwcKWt6DKt+8KRVDXFt
 cKmEX9P8sxFmd/bKzadf9Xp+qlQg8oaE+5PrtQAEiQCqU0hdoVvnKPA+9Ija4KZI
 rRX9x7mQEwG9wZkZEUMF2juQBejg60m2zP6rweltcTFOeuw0mmvkIyXjXoGOc/bg
 IOu+Ph40gcleOKt6r4Q=
 =E9n6
 -----END PGP SIGNATURE-----

Merge tag 'imx-drm-next-2018-02-22' of git://git.pengutronix.de/git/pza/linux into drm-fixes

drm/imx: ipu-v3 fixups and grayscale support

- Make const interrupt register arrays static, reduces object size.
- Fix device_node leaks in PRE/PRG phandle lookup functions.
- Add 8-bit and 16-bit grayscale buffer support to ipu_cpmem_set_image,
- add 10-bit and 12-bit grayscale media bus support to ipu-csi,
  to be used by the imx-media driver.

* tag 'imx-drm-next-2018-02-22' of git://git.pengutronix.de/git/pza/linux:
  gpu: ipu-csi: add 10/12-bit grayscale support to mbus_code_to_bus_cfg
  gpu: ipu-cpmem: add 16-bit grayscale support to ipu_cpmem_set_image
  gpu: ipu-v3: prg: fix device node leak in ipu_prg_lookup_by_phandle
  gpu: ipu-v3: pre: fix device node leak in ipu_pre_lookup_by_phandle
  gpu: ipu-cpmem: add 8-bit grayscale support to ipu_cpmem_set_image
  gpu: ipu-v3: make const arrays int_reg static, shrinks object size
This commit is contained in:
Dave Airlie 2018-02-23 11:11:57 +10:00
commit b17800e9b7
5 changed files with 12 additions and 2 deletions

View File

@ -1089,7 +1089,7 @@ static void ipu_irq_handler(struct irq_desc *desc)
{
struct ipu_soc *ipu = irq_desc_get_handler_data(desc);
struct irq_chip *chip = irq_desc_get_chip(desc);
const int int_reg[] = { 0, 1, 2, 3, 10, 11, 12, 13, 14};
static const int int_reg[] = { 0, 1, 2, 3, 10, 11, 12, 13, 14};
chained_irq_enter(chip, desc);
@ -1102,7 +1102,7 @@ static void ipu_err_irq_handler(struct irq_desc *desc)
{
struct ipu_soc *ipu = irq_desc_get_handler_data(desc);
struct irq_chip *chip = irq_desc_get_chip(desc);
const int int_reg[] = { 4, 5, 8, 9};
static const int int_reg[] = { 4, 5, 8, 9};
chained_irq_enter(chip, desc);

View File

@ -788,12 +788,14 @@ int ipu_cpmem_set_image(struct ipuv3_channel *ch, struct ipu_image *image)
case V4L2_PIX_FMT_SGBRG8:
case V4L2_PIX_FMT_SGRBG8:
case V4L2_PIX_FMT_SRGGB8:
case V4L2_PIX_FMT_GREY:
offset = image->rect.left + image->rect.top * pix->bytesperline;
break;
case V4L2_PIX_FMT_SBGGR16:
case V4L2_PIX_FMT_SGBRG16:
case V4L2_PIX_FMT_SGRBG16:
case V4L2_PIX_FMT_SRGGB16:
case V4L2_PIX_FMT_Y16:
offset = image->rect.left * 2 +
image->rect.top * pix->bytesperline;
break;

View File

@ -288,6 +288,7 @@ static int mbus_code_to_bus_cfg(struct ipu_csi_bus_config *cfg, u32 mbus_code)
case MEDIA_BUS_FMT_SGBRG10_1X10:
case MEDIA_BUS_FMT_SGRBG10_1X10:
case MEDIA_BUS_FMT_SRGGB10_1X10:
case MEDIA_BUS_FMT_Y10_1X10:
cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER;
cfg->mipi_dt = MIPI_DT_RAW10;
cfg->data_width = IPU_CSI_DATA_WIDTH_10;
@ -296,6 +297,7 @@ static int mbus_code_to_bus_cfg(struct ipu_csi_bus_config *cfg, u32 mbus_code)
case MEDIA_BUS_FMT_SGBRG12_1X12:
case MEDIA_BUS_FMT_SGRBG12_1X12:
case MEDIA_BUS_FMT_SRGGB12_1X12:
case MEDIA_BUS_FMT_Y12_1X12:
cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER;
cfg->mipi_dt = MIPI_DT_RAW12;
cfg->data_width = IPU_CSI_DATA_WIDTH_12;

View File

@ -129,11 +129,14 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
if (pre_node == pre->dev->of_node) {
mutex_unlock(&ipu_pre_list_mutex);
device_link_add(dev, pre->dev, DL_FLAG_AUTOREMOVE);
of_node_put(pre_node);
return pre;
}
}
mutex_unlock(&ipu_pre_list_mutex);
of_node_put(pre_node);
return NULL;
}

View File

@ -102,11 +102,14 @@ ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
mutex_unlock(&ipu_prg_list_mutex);
device_link_add(dev, prg->dev, DL_FLAG_AUTOREMOVE);
prg->id = ipu_id;
of_node_put(prg_node);
return prg;
}
}
mutex_unlock(&ipu_prg_list_mutex);
of_node_put(prg_node);
return NULL;
}