* [PATCH] soc-camera: fix S_CROP breakage on PXA and SuperH
@ 2009-01-11 0:53 Guennadi Liakhovetski
2009-01-11 23:59 ` Robert Jarzmik
0 siblings, 1 reply; 2+ messages in thread
From: Guennadi Liakhovetski @ 2009-01-11 0:53 UTC (permalink / raw)
To: Linux Media Mailing List; +Cc: Robert Jarzmik, Magnus Damm
Recent format-negotiation patches caused S_CROP breakage in pxa_camera.c
and sh_mobile_ceu_camera.c drivers, fix it.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
Tested on PXA, Magnus, please test on sh, Robert, any objections?
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index a1d6008..07c334f 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -1155,23 +1155,23 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd,
{
struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
struct pxa_camera_dev *pcdev = ici->priv;
- const struct soc_camera_data_format *host_fmt, *cam_fmt = NULL;
- const struct soc_camera_format_xlate *xlate;
+ const struct soc_camera_data_format *cam_fmt = NULL;
+ const struct soc_camera_format_xlate *xlate = NULL;
struct soc_camera_sense sense = {
.master_clock = pcdev->mclk,
.pixel_clock_max = pcdev->ciclk / 4,
};
- int ret, buswidth;
+ int ret;
- xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
- if (!xlate) {
- dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
- return -EINVAL;
- }
+ if (pixfmt) {
+ xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
+ if (!xlate) {
+ dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
+ return -EINVAL;
+ }
- buswidth = xlate->buswidth;
- host_fmt = xlate->host_fmt;
- cam_fmt = xlate->cam_fmt;
+ cam_fmt = xlate->cam_fmt;
+ }
/* If PCLK is used to latch data from the sensor, check sense */
if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN)
@@ -1201,8 +1201,8 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd,
}
if (pixfmt && !ret) {
- icd->buswidth = buswidth;
- icd->current_fmt = host_fmt;
+ icd->buswidth = xlate->buswidth;
+ icd->current_fmt = xlate->host_fmt;
}
return ret;
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c
index 9a2586b..ddcb81d 100644
--- a/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/drivers/media/video/sh_mobile_ceu_camera.c
@@ -603,21 +603,18 @@ static int sh_mobile_ceu_set_fmt(struct soc_camera_device *icd,
const struct soc_camera_format_xlate *xlate;
int ret;
+ if (!pixfmt)
+ return icd->ops->set_fmt(icd, pixfmt, rect);
+
xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
if (!xlate) {
dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
return -EINVAL;
}
- switch (pixfmt) {
- case 0: /* Only geometry change */
- ret = icd->ops->set_fmt(icd, pixfmt, rect);
- break;
- default:
- ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect);
- }
+ ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect);
- if (pixfmt && !ret) {
+ if (!ret) {
icd->buswidth = xlate->buswidth;
icd->current_fmt = xlate->host_fmt;
pcdev->camera_fmt = xlate->cam_fmt;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] soc-camera: fix S_CROP breakage on PXA and SuperH
2009-01-11 0:53 [PATCH] soc-camera: fix S_CROP breakage on PXA and SuperH Guennadi Liakhovetski
@ 2009-01-11 23:59 ` Robert Jarzmik
0 siblings, 0 replies; 2+ messages in thread
From: Robert Jarzmik @ 2009-01-11 23:59 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: Linux Media Mailing List, Magnus Damm
Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:
> Recent format-negotiation patches caused S_CROP breakage in pxa_camera.c
> and sh_mobile_ceu_camera.c drivers, fix it.
> Tested on PXA, Magnus, please test on sh, Robert, any objections?
No objection, that seems very sensible, and it was a regression introduced by
the format negotiation, no doubt about it, sorry :(
It's fine by me, and tested (also I don't work with S_CROP so I can only testify
non-regression of my tests).
Cheers.
--
Robert
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-12 0:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-11 0:53 [PATCH] soc-camera: fix S_CROP breakage on PXA and SuperH Guennadi Liakhovetski
2009-01-11 23:59 ` Robert Jarzmik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox