mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
drm/rockchip: driver: add interface to get format bpp
drm_format_info can't offer yuv afbc bpp info, so we add this interface to replenish it. Signed-off-by: Sandy Huang <hjc@rock-chips.com> Change-Id: Ib4d5f804b2ccdc20909420acd4911aa159d5a6fc
This commit is contained in:
@@ -45,6 +45,28 @@
|
||||
static bool is_support_iommu = true;
|
||||
static struct drm_driver rockchip_drm_driver;
|
||||
|
||||
uint32_t rockchip_drm_get_bpp(const struct drm_format_info *info)
|
||||
{
|
||||
/* use whatever a driver has set */
|
||||
if (info->cpp[0])
|
||||
return info->cpp[0] * 8;
|
||||
|
||||
switch (info->format) {
|
||||
case DRM_FORMAT_YUV420_8BIT:
|
||||
return 12;
|
||||
case DRM_FORMAT_YUV420_10BIT:
|
||||
return 15;
|
||||
case DRM_FORMAT_VUY101010:
|
||||
return 30;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* all attempts failed */
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(rockchip_drm_get_bpp);
|
||||
|
||||
/**
|
||||
* rockchip_drm_of_find_possible_crtcs - find the possible CRTCs for an active
|
||||
* encoder port
|
||||
|
||||
@@ -9,8 +9,9 @@
|
||||
#ifndef _ROCKCHIP_DRM_DRV_H
|
||||
#define _ROCKCHIP_DRM_DRV_H
|
||||
|
||||
#include <drm/drm_fb_helper.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_fb_helper.h>
|
||||
#include <drm/drm_fourcc.h>
|
||||
#include <drm/drm_gem.h>
|
||||
#include <drm/rockchip_drm.h>
|
||||
#include <linux/module.h>
|
||||
@@ -231,6 +232,7 @@ static inline int rockchip_drm_get_sub_dev_type(void)
|
||||
int rockchip_drm_endpoint_is_subdriver(struct device_node *ep);
|
||||
uint32_t rockchip_drm_of_find_possible_crtcs(struct drm_device *dev,
|
||||
struct device_node *port);
|
||||
uint32_t rockchip_drm_get_bpp(const struct drm_format_info *info);
|
||||
|
||||
extern struct platform_driver cdn_dp_driver;
|
||||
extern struct platform_driver dw_hdmi_rockchip_pltfm_driver;
|
||||
|
||||
Reference in New Issue
Block a user