aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2012-04-05 14:35:15 -0400
committerDave Airlie <airlied@redhat.com>2012-04-20 07:37:11 -0400
commit141670e9b4356b59b5b39a99e10ac0118d12b16d (patch)
treebe9a6888f93cccae323f623ac0e523356c25792b /drivers/gpu/drm/drm_crtc.c
parentae85226ebe474c9ecfc257191edca184b70ffbc2 (diff)
drm: Move drm_format_num_planes() to drm_crtc.c
There will be a need for this function in drm_crtc.c later. This avoids making drm_crtc.c depend on drm_crtc_helper.c. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r--drivers/gpu/drm/drm_crtc.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index d3aaeb6ae236..32ab669f4aed 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -3466,3 +3466,35 @@ void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
3466 } 3466 }
3467} 3467}
3468EXPORT_SYMBOL(drm_fb_get_bpp_depth); 3468EXPORT_SYMBOL(drm_fb_get_bpp_depth);
3469
3470/**
3471 * drm_format_num_planes - get the number of planes for format
3472 * @format: pixel format (DRM_FORMAT_*)
3473 *
3474 * RETURNS:
3475 * The number of planes used by the specified pixel format.
3476 */
3477int drm_format_num_planes(uint32_t format)
3478{
3479 switch (format) {
3480 case DRM_FORMAT_YUV410:
3481 case DRM_FORMAT_YVU410:
3482 case DRM_FORMAT_YUV411:
3483 case DRM_FORMAT_YVU411:
3484 case DRM_FORMAT_YUV420:
3485 case DRM_FORMAT_YVU420:
3486 case DRM_FORMAT_YUV422:
3487 case DRM_FORMAT_YVU422:
3488 case DRM_FORMAT_YUV444:
3489 case DRM_FORMAT_YVU444:
3490 return 3;
3491 case DRM_FORMAT_NV12:
3492 case DRM_FORMAT_NV21:
3493 case DRM_FORMAT_NV16:
3494 case DRM_FORMAT_NV61:
3495 return 2;
3496 default:
3497 return 1;
3498 }
3499}
3500EXPORT_SYMBOL(drm_format_num_planes);