diff options
author | Dave Airlie <airlied@redhat.com> | 2011-11-29 15:02:54 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-11-29 15:02:54 -0500 |
commit | 248dbc2350501e2c7b9f5ceb60c75515d82f4134 (patch) | |
tree | fb12f25d61f71eeba77931b96e58950fc9afd46f /drivers/gpu/drm/drm_crtc_helper.c | |
parent | 435ddd926e880f14ea2ae37062b9b45231d7fdf9 (diff) |
drm: move the fb bpp/depth helper into the core.
This is used by nearly everyone including vmwgfx which doesn't generally
use the fb helper.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc_helper.c | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 432d5391b93c..2ce61d72d416 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
@@ -811,54 +811,13 @@ void drm_helper_connector_dpms(struct drm_connector *connector, int mode) | |||
811 | } | 811 | } |
812 | EXPORT_SYMBOL(drm_helper_connector_dpms); | 812 | EXPORT_SYMBOL(drm_helper_connector_dpms); |
813 | 813 | ||
814 | /* | ||
815 | * Just need to support RGB formats here for compat with code that doesn't | ||
816 | * use pixel formats directly yet. | ||
817 | */ | ||
818 | void drm_helper_get_fb_bpp_depth(uint32_t format, unsigned int *depth, | ||
819 | int *bpp) | ||
820 | { | ||
821 | switch (format) { | ||
822 | case DRM_FOURCC_RGB332: | ||
823 | *depth = 8; | ||
824 | *bpp = 8; | ||
825 | break; | ||
826 | case DRM_FOURCC_RGB555: | ||
827 | *depth = 15; | ||
828 | *bpp = 16; | ||
829 | break; | ||
830 | case DRM_FOURCC_RGB565: | ||
831 | *depth = 16; | ||
832 | *bpp = 16; | ||
833 | break; | ||
834 | case DRM_FOURCC_RGB24: | ||
835 | *depth = 24; | ||
836 | *bpp = 32; | ||
837 | break; | ||
838 | case DRM_INTEL_RGB30: | ||
839 | *depth = 30; | ||
840 | *bpp = 32; | ||
841 | break; | ||
842 | case DRM_FOURCC_RGB32: | ||
843 | *depth = 32; | ||
844 | *bpp = 32; | ||
845 | break; | ||
846 | default: | ||
847 | DRM_DEBUG_KMS("unsupported pixel format\n"); | ||
848 | *depth = 0; | ||
849 | *bpp = 0; | ||
850 | break; | ||
851 | } | ||
852 | } | ||
853 | EXPORT_SYMBOL(drm_helper_get_fb_bpp_depth); | ||
854 | |||
855 | int drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb, | 814 | int drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb, |
856 | struct drm_mode_fb_cmd2 *mode_cmd) | 815 | struct drm_mode_fb_cmd2 *mode_cmd) |
857 | { | 816 | { |
858 | fb->width = mode_cmd->width; | 817 | fb->width = mode_cmd->width; |
859 | fb->height = mode_cmd->height; | 818 | fb->height = mode_cmd->height; |
860 | fb->pitch = mode_cmd->pitches[0]; | 819 | fb->pitch = mode_cmd->pitches[0]; |
861 | drm_helper_get_fb_bpp_depth(mode_cmd->pixel_format, &fb->depth, | 820 | drm_fb_get_bpp_depth(mode_cmd->pixel_format, &fb->depth, |
862 | &fb->bits_per_pixel); | 821 | &fb->bits_per_pixel); |
863 | fb->pixel_format = mode_cmd->pixel_format; | 822 | fb->pixel_format = mode_cmd->pixel_format; |
864 | 823 | ||