diff --git a/linux-5.10/common_patch/hdf.patch b/linux-5.10/common_patch/hdf.patch index 005bb6c44c3daa4ce186bf2af05b9c82bc485c93..4e03fc3309d47782c8d5f99fc6c2d50505dd4879 100644 --- a/linux-5.10/common_patch/hdf.patch +++ b/linux-5.10/common_patch/hdf.patch @@ -334,11 +334,12 @@ diff --git a/include/linux/hid.h b/include/linux/hid.h index 6ed2a97eb..1d1445a23 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h -@@ -622,6 +622,7 @@ struct hid_device { /* device report descriptor */ +@@ -624,6 +624,7 @@ struct hid_device { /* device report descriptor */ struct list_head debug_list; spinlock_t debug_list_lock; wait_queue_head_t debug_wait; + void *input_dev; - }; + struct kref ref; - #define to_hid_device(pdev) \ + unsigned int id; /* system unique id */ + diff --git a/linux-5.10/rk3568_patch/hdf.patch b/linux-5.10/rk3568_patch/hdf.patch index a12aa6ad0937fca0710fc44513c8c8cbca5e769d..dd2d4580132959b965a5de8d622fa8dc2c48b8d7 100644 --- a/linux-5.10/rk3568_patch/hdf.patch +++ b/linux-5.10/rk3568_patch/hdf.patch @@ -443,14 +443,14 @@ diff --git a/include/linux/hid.h b/include/linux/hid.h index 6ed2a97eb..1d1445a23 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h -@@ -622,6 +622,7 @@ struct hid_device { /* device report descriptor */ +@@ -624,6 +624,7 @@ struct hid_device { /* device report descriptor */ struct list_head debug_list; spinlock_t debug_list_lock; wait_queue_head_t debug_wait; + void *input_dev; - }; + struct kref ref; - #define to_hid_device(pdev) \ + unsigned int id; /* system unique id */ diff --git a/include/linux/usb.h b/include/linux/usb.h index d6a41841b..de3232ee5 100644 --- a/include/linux/usb.h diff --git a/linux-5.10/rk3568_patch/kernel.patch b/linux-5.10/rk3568_patch/kernel.patch index 59a0db640bc3c67211c3086ac654e876dbc5f9ac..b62f373be37e8d6bbc7590f3b752f59c65f3ef24 100755 --- a/linux-5.10/rk3568_patch/kernel.patch +++ b/linux-5.10/rk3568_patch/kernel.patch @@ -609065,8 +609065,8 @@ index af98bfcde518..b80ef0c6dc53 100644 + return readl(vop->lut_regs + offset); } - static bool has_rb_swapped(uint32_t format) -@@ -276,11 +601,19 @@ static enum vop_data_format vop_convert_format(uint32_t format) + static bool has_rb_swapped(uint32_t version, uint32_t format) +@@ -284,11 +609,19 @@ static enum vop_data_format vop_convert_format(uint32_t format) case DRM_FORMAT_BGR565: return VOP_FMT_RGB565; case DRM_FORMAT_NV12: @@ -609086,7 +609086,7 @@ index af98bfcde518..b80ef0c6dc53 100644 default: DRM_ERROR("unsupported format[%08x]\n", format); return -EINVAL; -@@ -294,13 +627,13 @@ static int vop_convert_afbc_format(uint32_t format) +@@ -302,13 +635,13 @@ static int vop_convert_afbc_format(uint32_t format) case DRM_FORMAT_ARGB8888: case DRM_FORMAT_XBGR8888: case DRM_FORMAT_ABGR8888: @@ -609103,7 +609103,7 @@ index af98bfcde518..b80ef0c6dc53 100644 /* either of the below should not be reachable */ default: DRM_WARN_ONCE("unsupported AFBC format[%08x]\n", format); -@@ -310,6 +643,148 @@ static int vop_convert_afbc_format(uint32_t format) +@@ -318,6 +651,148 @@ static int vop_convert_afbc_format(uint32_t format) return -EINVAL; } @@ -609252,7 +609252,7 @@ index af98bfcde518..b80ef0c6dc53 100644 static uint16_t scl_vop_cal_scale(enum scale_mode mode, uint32_t src, uint32_t dst, bool is_horizontal, int vsu_mode, int *vskiplines) -@@ -344,29 +819,48 @@ static uint16_t scl_vop_cal_scale(enum scale_mode mode, uint32_t src, +@@ -352,29 +827,48 @@ static uint16_t scl_vop_cal_scale(enum scale_mode mode, uint32_t src, return val; } @@ -609310,7 +609310,7 @@ index af98bfcde518..b80ef0c6dc53 100644 if (!win->phy->scl->ext) { VOP_SCL_SET(vop, win, scale_yrgb_x, scl_cal_scale2(src_w, dst_w)); -@@ -448,38 +942,404 @@ static void scl_vop_cal_scl_fac(struct vop *vop, const struct vop_win_data *win, +@@ -456,38 +950,404 @@ static void scl_vop_cal_scl_fac(struct vop *vop, const struct vop_win_data *win, } } @@ -609735,7 +609735,7 @@ index af98bfcde518..b80ef0c6dc53 100644 * (2) the active data region of each frame ends at dsp_vact_end * (3) we should program this same number (dsp_vact_end) into dsp_line_frag_num, * to get "LINE_FLAG" interrupt at the end of the active on screen data. -@@ -567,147 +1427,234 @@ static void vop_core_clks_disable(struct vop *vop) +@@ -575,147 +1435,234 @@ static void vop_core_clks_disable(struct vop *vop) clk_disable(vop->hclk); } @@ -610065,7 +610065,7 @@ index af98bfcde518..b80ef0c6dc53 100644 /* * Vop standby will take effect at end of current frame, -@@ -721,24 +1668,32 @@ static void vop_crtc_atomic_disable(struct drm_crtc *crtc, +@@ -729,24 +1676,32 @@ static void vop_crtc_atomic_disable(struct drm_crtc *crtc, spin_lock(&vop->reg_lock); @@ -610107,7 +610107,7 @@ index af98bfcde518..b80ef0c6dc53 100644 mutex_unlock(&vop->vop_lock); -@@ -752,23 +1707,29 @@ static void vop_crtc_atomic_disable(struct drm_crtc *crtc, +@@ -760,23 +1715,29 @@ static void vop_crtc_atomic_disable(struct drm_crtc *crtc, } } @@ -610144,7 +610144,7 @@ index af98bfcde518..b80ef0c6dc53 100644 DRM_DEBUG_KMS("Unsupported format modifier 0x%llx\n", modifier); return false; -@@ -783,34 +1744,90 @@ static int vop_plane_atomic_check(struct drm_plane *plane, +@@ -791,34 +1752,90 @@ static int vop_plane_atomic_check(struct drm_plane *plane, struct drm_crtc *crtc = state->crtc; struct drm_crtc_state *crtc_state; struct drm_framebuffer *fb = state->fb; @@ -610243,7 +610243,7 @@ index af98bfcde518..b80ef0c6dc53 100644 /* * Src.x1 can be odd when do clip, but yuv plane start point * need align with 2 pixel. -@@ -825,28 +1842,28 @@ static int vop_plane_atomic_check(struct drm_plane *plane, +@@ -833,28 +1850,28 @@ static int vop_plane_atomic_check(struct drm_plane *plane, return -EINVAL; } @@ -610290,7 +610290,7 @@ index af98bfcde518..b80ef0c6dc53 100644 } return 0; -@@ -855,44 +1872,148 @@ static int vop_plane_atomic_check(struct drm_plane *plane, +@@ -863,44 +1880,148 @@ static int vop_plane_atomic_check(struct drm_plane *plane, static void vop_plane_atomic_disable(struct drm_plane *plane, struct drm_plane_state *old_state) { @@ -610455,7 +610455,7 @@ index af98bfcde518..b80ef0c6dc53 100644 /* * can't update plane when vop is disabled. -@@ -908,206 +2029,448 @@ static void vop_plane_atomic_update(struct drm_plane *plane, +@@ -916,206 +2037,448 @@ static void vop_plane_atomic_update(struct drm_plane *plane, return; } @@ -610584,7 +610584,7 @@ index af98bfcde518..b80ef0c6dc53 100644 VOP_WIN_SET(vop, win, dsp_info, dsp_info); VOP_WIN_SET(vop, win, dsp_st, dsp_st); - rb_swap = has_rb_swapped(fb->format->format); + rb_swap = has_rb_swapped(vop->data->version, fb->format->format); - VOP_WIN_SET(vop, win, rb_swap, rb_swap); - /* @@ -611044,7 +611044,7 @@ index af98bfcde518..b80ef0c6dc53 100644 }; static int vop_crtc_enable_vblank(struct drm_crtc *crtc) -@@ -1120,8 +2483,13 @@ static int vop_crtc_enable_vblank(struct drm_crtc *crtc) +@@ -1128,8 +2491,13 @@ static int vop_crtc_enable_vblank(struct drm_crtc *crtc) spin_lock_irqsave(&vop->irq_lock, flags); @@ -611060,7 +611060,7 @@ index af98bfcde518..b80ef0c6dc53 100644 spin_unlock_irqrestore(&vop->irq_lock, flags); -@@ -1131,265 +2499,1494 @@ static int vop_crtc_enable_vblank(struct drm_crtc *crtc) +@@ -1139,265 +2507,1494 @@ static int vop_crtc_enable_vblank(struct drm_crtc *crtc) static void vop_crtc_disable_vblank(struct drm_crtc *crtc) { struct vop *vop = to_vop(crtc); @@ -612757,7 +612757,7 @@ index af98bfcde518..b80ef0c6dc53 100644 } static void vop_wait_for_irq_handler(struct vop *vop) -@@ -1413,72 +4010,67 @@ static void vop_wait_for_irq_handler(struct vop *vop) +@@ -1421,72 +4018,67 @@ static void vop_wait_for_irq_handler(struct vop *vop) synchronize_irq(vop->irq); } @@ -612878,7 +612878,7 @@ index af98bfcde518..b80ef0c6dc53 100644 /* * There is a (rather unlikely) possiblity that a vblank interrupt -@@ -1496,13 +4088,11 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, +@@ -1504,13 +4096,11 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, crtc->state->event = NULL; } spin_unlock_irq(&crtc->dev->event_lock); @@ -612894,7 +612894,7 @@ index af98bfcde518..b80ef0c6dc53 100644 continue; drm_framebuffer_get(old_plane_state->fb); -@@ -1514,8 +4104,8 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, +@@ -1522,8 +4112,8 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, static const struct drm_crtc_helper_funcs vop_crtc_helper_funcs = { .mode_fixup = vop_crtc_mode_fixup, @@ -612904,7 +612904,7 @@ index af98bfcde518..b80ef0c6dc53 100644 .atomic_flush = vop_crtc_atomic_flush, .atomic_enable = vop_crtc_atomic_enable, .atomic_disable = vop_crtc_atomic_disable, -@@ -1526,15 +4116,36 @@ static void vop_crtc_destroy(struct drm_crtc *crtc) +@@ -1534,15 +4124,36 @@ static void vop_crtc_destroy(struct drm_crtc *crtc) drm_crtc_cleanup(crtc); } @@ -612944,7 +612944,7 @@ index af98bfcde518..b80ef0c6dc53 100644 if (!rockchip_state) return NULL; -@@ -1551,20 +4162,6 @@ static void vop_crtc_destroy_state(struct drm_crtc *crtc, +@@ -1559,20 +4170,6 @@ static void vop_crtc_destroy_state(struct drm_crtc *crtc, kfree(s); } @@ -612965,7 +612965,7 @@ index af98bfcde518..b80ef0c6dc53 100644 #ifdef CONFIG_DRM_ANALOGIX_DP static struct drm_connector *vop_get_edp_connector(struct vop *vop) { -@@ -1628,20 +4225,118 @@ vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name, +@@ -1636,20 +4233,118 @@ vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name, { return -ENODEV; } @@ -613086,7 +613086,7 @@ index af98bfcde518..b80ef0c6dc53 100644 }; static void vop_fb_unref_worker(struct drm_flip_work *work, void *val) -@@ -1649,22 +4344,23 @@ static void vop_fb_unref_worker(struct drm_flip_work *work, void *val) +@@ -1657,22 +4352,23 @@ static void vop_fb_unref_worker(struct drm_flip_work *work, void *val) struct vop *vop = container_of(work, struct vop, fb_unref_work); struct drm_framebuffer *fb = val; @@ -613114,7 +613114,7 @@ index af98bfcde518..b80ef0c6dc53 100644 if (test_and_clear_bit(VOP_PENDING_FB_UNREF, &vop->pending)) drm_flip_work_commit(&vop->fb_unref_work, system_unbound_wq); -@@ -1673,8 +4369,9 @@ static void vop_handle_vblank(struct vop *vop) +@@ -1681,8 +4377,9 @@ static void vop_handle_vblank(struct vop *vop) static irqreturn_t vop_isr(int irq, void *data) { struct vop *vop = data; @@ -613125,7 +613125,7 @@ index af98bfcde518..b80ef0c6dc53 100644 int ret = IRQ_NONE; /* -@@ -1693,14 +4390,14 @@ static irqreturn_t vop_isr(int irq, void *data) +@@ -1701,14 +4398,14 @@ static irqreturn_t vop_isr(int irq, void *data) * interrupt register has interrupt status, enable and clear bits, we * must hold irq_lock to avoid a race with enable/disable_vblank(). */ @@ -613142,7 +613142,7 @@ index af98bfcde518..b80ef0c6dc53 100644 /* This is expected for vop iommu irqs, since the irq is shared */ if (!active_irqs) -@@ -1718,17 +4415,42 @@ static irqreturn_t vop_isr(int irq, void *data) +@@ -1726,17 +4423,42 @@ static irqreturn_t vop_isr(int irq, void *data) ret = IRQ_HANDLED; } @@ -613189,7 +613189,7 @@ index af98bfcde518..b80ef0c6dc53 100644 out_disable: vop_core_clks_disable(vop); -@@ -1737,27 +4459,230 @@ static irqreturn_t vop_isr(int irq, void *data) +@@ -1745,27 +4467,230 @@ static irqreturn_t vop_isr(int irq, void *data) return ret; } @@ -613427,7 +613427,7 @@ index af98bfcde518..b80ef0c6dc53 100644 int i; /* -@@ -1765,29 +4690,20 @@ static int vop_create_crtc(struct vop *vop) +@@ -1773,29 +4698,20 @@ static int vop_create_crtc(struct vop *vop) * to pass them to drm_crtc_init_with_planes, which sets the * "possible_crtcs" to the newly initialized crtc. */ @@ -613464,7 +613464,7 @@ index af98bfcde518..b80ef0c6dc53 100644 if (plane->type == DRM_PLANE_TYPE_PRIMARY) primary = plane; else if (plane->type == DRM_PLANE_TYPE_CURSOR) -@@ -1800,37 +4716,24 @@ static int vop_create_crtc(struct vop *vop) +@@ -1808,37 +4724,24 @@ static int vop_create_crtc(struct vop *vop) goto err_cleanup_planes; drm_crtc_helper_add(crtc, &vop_crtc_helper_funcs); @@ -613508,7 +613508,7 @@ index af98bfcde518..b80ef0c6dc53 100644 } port = of_get_child_by_name(dev->of_node, "port"); -@@ -1847,15 +4750,64 @@ static int vop_create_crtc(struct vop *vop) +@@ -1855,15 +4758,64 @@ static int vop_create_crtc(struct vop *vop) init_completion(&vop->dsp_hold_completion); init_completion(&vop->line_flag_completion); crtc->port = port; @@ -613576,7 +613576,7 @@ index af98bfcde518..b80ef0c6dc53 100644 err_cleanup_crtc: drm_crtc_cleanup(crtc); err_cleanup_planes: -@@ -1867,7 +4819,7 @@ static int vop_create_crtc(struct vop *vop) +@@ -1875,7 +4827,7 @@ static int vop_create_crtc(struct vop *vop) static void vop_destroy_crtc(struct vop *vop) { @@ -613585,7 +613585,7 @@ index af98bfcde518..b80ef0c6dc53 100644 struct drm_device *drm_dev = vop->drm_dev; struct drm_plane *plane, *tmp; -@@ -1895,187 +4847,129 @@ static void vop_destroy_crtc(struct vop *vop) +@@ -1903,187 +4855,129 @@ static void vop_destroy_crtc(struct vop *vop) drm_flip_work_cleanup(&vop->fb_unref_work); } @@ -613869,7 +613869,7 @@ index af98bfcde518..b80ef0c6dc53 100644 static int vop_bind(struct device *dev, struct device *master, void *data) { -@@ -2084,46 +4978,97 @@ static int vop_bind(struct device *dev, struct device *master, void *data) +@@ -2092,46 +4986,97 @@ static int vop_bind(struct device *dev, struct device *master, void *data) struct drm_device *drm_dev = data; struct vop *vop; struct resource *res; @@ -613980,7 +613980,7 @@ index af98bfcde518..b80ef0c6dc53 100644 irq = platform_get_irq(pdev, 0); if (irq < 0) { DRM_DEV_ERROR(dev, "cannot find irq for vop\n"); -@@ -2135,53 +5080,51 @@ static int vop_bind(struct device *dev, struct device *master, void *data) +@@ -2143,53 +5088,51 @@ static int vop_bind(struct device *dev, struct device *master, void *data) spin_lock_init(&vop->irq_lock); mutex_init(&vop->vop_lock); @@ -1615678,24 +1615678,6 @@ index d5f4ec1b73b1..4989ec761667 } urb->actual_length += xfer_length; -@@ -2065,8 +2068,6 @@ static void dwc2_hc_n_intr(struct dwc2_hsotg *hsotg, int chnum) - hcint, hcintmsk, hcint & hcintmsk); - } - -- dwc2_writel(hsotg, hcint, HCINT(chnum)); -- - /* - * If we got an interrupt after someone called - * dwc2_hcd_endpoint_disable() we don't want to crash below -@@ -2079,6 +2080,8 @@ static void dwc2_hc_n_intr(struct dwc2_hsotg *hsotg, int chnum) - chan->hcint = hcint; - hcint &= hcintmsk; - -+ dwc2_writel(hsotg, hcint, HCINT(chnum)); -+ - /* - * If the channel was halted due to a dequeue, the qtd list might - * be empty or at least the first entry will not be the active qtd. diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c old mode 100644 new mode 100755