Skip to content

Commit

Permalink
Merge tag 'imx-drm-next-2018-02-22' of git://git.pengutronix.de/git/p…
Browse files Browse the repository at this point in the history
…za/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
  • Loading branch information
airlied committed Feb 23, 2018
2 parents dfe8db2 + 50b0f0a commit b17800e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/ipu-v3/ipu-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/ipu-v3/ipu-cpmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/ipu-v3/ipu-csi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/ipu-v3/ipu-pre.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/ipu-v3/ipu-prg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b17800e

Please sign in to comment.