Commit 141670e9b4356b59b5b39a99e10ac0118d12b16d

Authored by Ville Syrjälä
Committed by Dave Airlie
1 parent ae85226ebe

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>

Showing 4 changed files with 34 additions and 35 deletions Side-by-side Diff

drivers/gpu/drm/drm_crtc.c
... ... @@ -3466,4 +3466,36 @@
3466 3466 }
3467 3467 }
3468 3468 EXPORT_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 + */
  3477 +int 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 +}
  3500 +EXPORT_SYMBOL(drm_format_num_planes);
drivers/gpu/drm/drm_crtc_helper.c
... ... @@ -1023,37 +1023,4 @@
1023 1023 queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, 0);
1024 1024 }
1025 1025 EXPORT_SYMBOL(drm_helper_hpd_irq_event);
1026   -
1027   -
1028   -/**
1029   - * drm_format_num_planes - get the number of planes for format
1030   - * @format: pixel format (DRM_FORMAT_*)
1031   - *
1032   - * RETURNS:
1033   - * The number of planes used by the specified pixel format.
1034   - */
1035   -int drm_format_num_planes(uint32_t format)
1036   -{
1037   - switch (format) {
1038   - case DRM_FORMAT_YUV410:
1039   - case DRM_FORMAT_YVU410:
1040   - case DRM_FORMAT_YUV411:
1041   - case DRM_FORMAT_YVU411:
1042   - case DRM_FORMAT_YUV420:
1043   - case DRM_FORMAT_YVU420:
1044   - case DRM_FORMAT_YUV422:
1045   - case DRM_FORMAT_YVU422:
1046   - case DRM_FORMAT_YUV444:
1047   - case DRM_FORMAT_YVU444:
1048   - return 3;
1049   - case DRM_FORMAT_NV12:
1050   - case DRM_FORMAT_NV21:
1051   - case DRM_FORMAT_NV16:
1052   - case DRM_FORMAT_NV61:
1053   - return 2;
1054   - default:
1055   - return 1;
1056   - }
1057   -}
1058   -EXPORT_SYMBOL(drm_format_num_planes);
include/drm/drm_crtc.h
... ... @@ -1026,5 +1026,7 @@
1026 1026  
1027 1027 extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
1028 1028 int *bpp);
  1029 +extern int drm_format_num_planes(uint32_t format);
  1030 +
1029 1031 #endif /* __DRM_CRTC_H__ */
include/drm/drm_crtc_helper.h
... ... @@ -145,7 +145,5 @@
145 145 extern void drm_kms_helper_poll_disable(struct drm_device *dev);
146 146 extern void drm_kms_helper_poll_enable(struct drm_device *dev);
147 147  
148   -extern int drm_format_num_planes(uint32_t format);
149   -
150 148 #endif