Skip to content

Instantly share code, notes, and snippets.

@sarim
Created June 2, 2020 16:35
Show Gist options
  • Save sarim/c6f39afaaec9fb5a1a7bac206727a95f to your computer and use it in GitHub Desktop.
Save sarim/c6f39afaaec9fb5a1a7bac206727a95f to your computer and use it in GitHub Desktop.
RPI3 kernel-panel-driver-overlay-vga.patch
diff --git a/arch/arm/boot/dts/overlays/vc4-kms-gittu-hdmi-overlay.dts b/arch/arm/boot/dts/overlays/vc4-kms-gittu-hdmi-overlay.dts
new file mode 100644
index 000000000..9fa4159e2
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/vc4-kms-gittu-hdmi-overlay.dts
@@ -0,0 +1,63 @@
+/*
+ * vc4-kms-v3d-overlay.dts
+ */
+
+/dts-v1/;
+/plugin/;
+/*
+#include <dt-bindings/pinctrl/bcm2835.h>
+*/
+/ {
+ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
+
+ fragment@0 {
+ target-path = "/";
+ __overlay__ {
+ panel: panel {
+ compatible = "ontat,yx700wv03", "simple-panel";
+
+ port {
+ panel_in: endpoint {
+ remote-endpoint = <&dpi_out>;
+ };
+ };
+ };
+ };
+ };
+
+ fragment@1 {
+ target = <&dpi>;
+ __overlay__ {
+ status = "okay";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&vga666_pins>;
+
+ port {
+ dpi_out: endpoint@0 {
+ remote-endpoint = <&panel_in>;
+ };
+ };
+ };
+ };
+
+ fragment@2 {
+ target = <&gpio>;
+ __overlay__ {
+ vga666_pins: vga666_pins {
+ brcm,pins = <2 3 4 5 6 7 8 9 10 11 12
+ 13 14 15 16 17 18 19 20 21>;
+ brcm,function = <6>; /* alt2 */
+ brcm,pull = <0>; /* no pull */
+ };
+ };
+ };
+
+ fragment@3 {
+ target = <&hdmi>;
+ __overlay__ {
+ compatible = "brcm,bcm2835-gittu";
+ status = "disabled";
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlays/vc4-kms-gittu-overlay.dts b/arch/arm/boot/dts/overlays/vc4-kms-gittu-overlay.dts
new file mode 100644
index 000000000..320fa1e63
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/vc4-kms-gittu-overlay.dts
@@ -0,0 +1,58 @@
+/*
+ * vc4-kms-v3d-overlay.dts
+ */
+
+/dts-v1/;
+/plugin/;
+/*
+#include <dt-bindings/pinctrl/bcm2835.h>
+*/
+/ {
+ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
+
+
+ fragment@0 {
+ target-path = "/";
+ __overlay__ {
+ panel: panel {
+ compatible = "ontat,yx700wv03", "simple-panel";
+
+ port {
+ panel_in: endpoint {
+ remote-endpoint = <&dpi_out>;
+ };
+ };
+ };
+ };
+ };
+
+ fragment@1 {
+ target = <&dpi>;
+ __overlay__ {
+ status = "okay";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&vga666_pins>;
+
+ port {
+ dpi_out: endpoint {
+ remote-endpoint = <&panel_in>;
+ };
+ };
+ };
+ };
+
+
+ fragment@2 {
+ target = <&gpio>;
+ __overlay__ {
+ vga666_pins: vga666_pins {
+ brcm,pins = <2 3 4 5 6 7 8 9 10 11 12
+ 13 14 15 16 17 18 19 20 21>;
+ brcm,function = <6>;
+ brcm,pull = <0>;
+ };
+ };
+ };
+
+};
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index fc56d033f..0143987c8 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -1535,18 +1535,19 @@ static const struct panel_desc olimex_lcd_olinuxino_43ts = {
* pixel clocks, but this is the timing that was being used in the Adafruit
* installation instructions.
*/
+ //edited by gittu
static const struct drm_display_mode ontat_yx700wv03_mode = {
- .clock = 29500,
- .hdisplay = 800,
- .hsync_start = 824,
- .hsync_end = 896,
- .htotal = 992,
- .vdisplay = 480,
- .vsync_start = 483,
- .vsync_end = 493,
- .vtotal = 500,
+ .clock = 85250,
+ .hdisplay = 1368,
+ .hsync_start = 1440,
+ .hsync_end = 1576,
+ .htotal = 1784,
+ .vdisplay = 768,
+ .vsync_start = 771,
+ .vsync_end = 781,
+ .vtotal = 798,
.vrefresh = 60,
- .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
+ .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC,
};
/*
@@ -2430,3 +2431,4 @@ module_exit(panel_simple_exit);
MODULE_AUTHOR("Thierry Reding <[email protected]>");
MODULE_DESCRIPTION("DRM Driver for Simple Panels");
MODULE_LICENSE("GPL and additional rights");
+
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index 982ec1bb3..767c77488 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -320,7 +320,7 @@ static const struct component_master_ops vc4_drm_ops = {
static struct platform_driver *const component_drivers[] = {
&vc4_hdmi_driver,
- &vc4_vec_driver,
+ //&vc4_vec_driver,
&vc4_dpi_driver,
&vc4_dsi_driver,
&vc4_hvs_driver,
https://github.com/lineage-rpi/android_kernel_brcm_rpi3.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment