Re: [PATCH 21/43] imx-drm: ipu-v3: Add ipu_bits_per_pixel()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Samstag, den 07.06.2014, 14:56 -0700 schrieb Steve Longerbeam:
> Add simple conversion from pixelformat to total bits-per-pixel.
[...]
> +/*
> + * Standard bpp from pixel format.
> + */
> +int ipu_bits_per_pixel(u32 pixelformat)
> +{
> +	switch (pixelformat) {
> +	case V4L2_PIX_FMT_YUV420:
> +	case V4L2_PIX_FMT_YVU420:
> +		return 12;
> +	case V4L2_PIX_FMT_RGB565:
> +	case V4L2_PIX_FMT_YUYV:
> +	case V4L2_PIX_FMT_UYVY:
> +		return 16;
> +	case V4L2_PIX_FMT_BGR24:
> +	case V4L2_PIX_FMT_RGB24:
> +		return 24;
> +	case V4L2_PIX_FMT_BGR32:
> +	case V4L2_PIX_FMT_RGB32:
> +		return 32;
> +	default:
> +		break;
> +	}
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(ipu_bits_per_pixel);

This isn't really IPU specific. Should we have a v4l2-wide helper for
this? Also, it seems that this is only ever used to calculate the
bytesperline, so why not return bytes per pixel directly?

regards
Philipp

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux