From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB
---
kernel/drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 43 ++++++++++++++++++++++++++++++++++++++++---
1 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/kernel/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/kernel/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index d5b93d5..9f64ad8 100644
--- a/kernel/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/kernel/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -37,7 +37,6 @@
#include "rockchip_drm_logo.h"
#include "../drm_crtc_internal.h"
-#include "../drivers/clk/rockchip/clk.h"
#define DRIVER_NAME "rockchip"
#define DRIVER_DESC "RockChip Soc DRM"
@@ -125,6 +124,7 @@
hbp = mode->htotal - mode->hsync_end;
mode->clock *= 2;
+ mode->crtc_clock *= 2;
mode->hdisplay = hactive * 2;
mode->hsync_start = mode->hdisplay + hfp * 2;
mode->hsync_end = mode->hsync_start + hsync * 2;
@@ -143,6 +143,7 @@
hbp = mode->htotal - mode->hsync_end;
mode->clock /= 2;
+ mode->crtc_clock /= 2;
mode->hdisplay = hactive / 2;
mode->hsync_start = mode->hdisplay + hfp / 2;
mode->hsync_end = mode->hsync_start + hsync / 2;
@@ -197,6 +198,30 @@
return 0;
}
EXPORT_SYMBOL(rockchip_drm_get_bpp);
+
+uint32_t rockchip_drm_get_cycles_per_pixel(uint32_t bus_format)
+{
+ switch (bus_format) {
+ case MEDIA_BUS_FMT_RGB565_1X16:
+ case MEDIA_BUS_FMT_RGB666_1X18:
+ case MEDIA_BUS_FMT_RGB888_1X24:
+ case MEDIA_BUS_FMT_RGB666_1X24_CPADHI:
+ return 1;
+ case MEDIA_BUS_FMT_RGB565_2X8_LE:
+ case MEDIA_BUS_FMT_BGR565_2X8_LE:
+ return 2;
+ case MEDIA_BUS_FMT_RGB666_3X6:
+ case MEDIA_BUS_FMT_RGB888_3X8:
+ case MEDIA_BUS_FMT_BGR888_3X8:
+ return 3;
+ case MEDIA_BUS_FMT_RGB888_DUMMY_4X8:
+ case MEDIA_BUS_FMT_BGR888_DUMMY_4X8:
+ return 4;
+ default:
+ return 1;
+ }
+}
+EXPORT_SYMBOL(rockchip_drm_get_cycles_per_pixel);
/**
* rockchip_drm_of_find_possible_crtcs - find the possible CRTCs for an active
@@ -1289,6 +1314,12 @@
}
#endif
+static const struct drm_prop_enum_list split_area[] = {
+ { ROCKCHIP_DRM_SPLIT_UNSET, "UNSET" },
+ { ROCKCHIP_DRM_SPLIT_LEFT_SIDE, "LEFT" },
+ { ROCKCHIP_DRM_SPLIT_RIGHT_SIDE, "RIGHT" },
+};
+
static int rockchip_drm_create_properties(struct drm_device *dev)
{
struct drm_property *prop;
@@ -1324,6 +1355,11 @@
return -ENOMEM;
private->connector_id_prop = prop;
+ prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "SPLIT_AREA",
+ split_area,
+ ARRAY_SIZE(split_area));
+ private->split_area_prop = prop;
+
prop = drm_property_create_object(dev,
DRM_MODE_PROP_ATOMIC | DRM_MODE_PROP_IMMUTABLE,
"SOC_ID", DRM_MODE_OBJECT_CRTC);
@@ -1337,6 +1373,9 @@
private->aclk_prop = drm_property_create_range(dev, 0, "ACLK", 0, UINT_MAX);
private->bg_prop = drm_property_create_range(dev, 0, "BACKGROUND", 0, UINT_MAX);
private->line_flag_prop = drm_property_create_range(dev, 0, "LINE_FLAG1", 0, UINT_MAX);
+ private->cubic_lut_prop = drm_property_create(dev, DRM_MODE_PROP_BLOB, "CUBIC_LUT", 0);
+ private->cubic_lut_size_prop = drm_property_create_range(dev, DRM_MODE_PROP_IMMUTABLE,
+ "CUBIC_LUT_SIZE", 0, UINT_MAX);
return drm_mode_create_tv_properties(dev, 0, NULL);
}
@@ -1543,8 +1582,6 @@
ret = drm_dev_register(drm_dev, 0);
if (ret)
goto err_kms_helper_poll_fini;
-
- rockchip_clk_unprotect();
return 0;
err_kms_helper_poll_fini:
--
Gitblit v1.6.2