Re: [Freedreno] [PATCH v1 3/3] drm/msm/dpu: simplify interrupt managing

2021-05-16 Thread Dmitry Baryshkov
On 16/05/2021 08:24, Bjorn Andersson wrote: On Sun 11 Apr 19:09 CDT 2021, Dmitry Baryshkov wrote: Change huge lookup table to contain just sensible entries. IRQ index is now not an index in the table, but just register id (multiplied by 32, the amount of IRQs in the register) plus offset in

[Freedreno] [PATCH v2 6/6] drm/msm/dpu: simplify IRQ enabling/disabling

2021-05-16 Thread Dmitry Baryshkov
Merge dpu_core_irq_enable() into dpu_core_irq_register_callback() and dpu_core_irq_disable() into dpu_core_irq_unregister_callback(), because they are called in pairs. There is no need to have separate enable/disable pair, we can enable hardware IRQ when first callback is registered and when the

[Freedreno] [PATCH v2 4/6] drm/msm/dpu: replace IRQ lookup with the data in hw catalog

2021-05-16 Thread Dmitry Baryshkov
The IRQ table in the dpu_hw_interrupts.h is big, ugly, and hard to maintain. There are only few interrupts used from that table. Newer generations use different IRQ locations. Move this data to hw catalog. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c | 20

[Freedreno] [PATCH v2 5/6] drm/msm/dpu: drop remains of old irq lookup subsystem

2021-05-16 Thread Dmitry Baryshkov
There is no more need for the dpu_intr_type types, dpu_irq_map table, individual intr defines and obsolete_irq field. Drop all of them now. Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h |2 - .../drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c |4 -

[Freedreno] [PATCH v2 2/6] drm/msm/dpu: hw_intr: always call dpu_hw_intr_clear_intr_status_nolock

2021-05-16 Thread Dmitry Baryshkov
Always call dpu_hw_intr_clear_intr_status_nolock() from the dpu_hw_intr_dispatch_irqs(). This simplifies the callback function (which call clears the interrupts anyway) and enforces clearing the hw interrupt status. Signed-off-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson ---

[Freedreno] [PATCH v2 3/6] drm/msm/dpu: define interrupt register names

2021-05-16 Thread Dmitry Baryshkov
In order to make mdss_irqs readable (and error-prone) define names for interrupt register indices. Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c| 45 --- .../gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.h | 18 2 files changed, 58

[Freedreno] [PATCH v2 1/6] drm/msm/dpu: merge dpu_hw_intr_get_interrupt_statuses into dpu_hw_intr_dispatch_irqs

2021-05-16 Thread Dmitry Baryshkov
There is little sense in reading interrupt statuses and right after that going after the array of statuses to dispatch them. Merge both loops into single function doing read and dispatch. Signed-off-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson ---

[Freedreno] [PATCH v2 0/6] drm/msm/dpu: rework irq handling

2021-05-16 Thread Dmitry Baryshkov
Simplify IRQ handling. dpu_irq_map is a huge table consisting of all possible IRQ entries (including a plenty of 'reserved' = not existing IRQs). It is always used to lookup the interrupt index (in the table) and then to use this index to lookup related interrupt register and mask. For the long

Re: [Freedreno] [PATCH] drm/msm/dpu: simplify dpu_core_irq_en/disable helpers

2021-05-16 Thread Dmitry Baryshkov
On 11/05/2021 17:15, Dmitry Baryshkov wrote: dpu_core_irq_en/disable helpers are always called with the irq_count equal to 1. Merge them with _dpu_core_en/disable functions and make them handle just one interrupt index at a time. Replacing this patch with the squashing enable/disable into

Re: [Freedreno] [PATCH v1 3/3] drm/msm/dpu: simplify interrupt managing

2021-05-16 Thread Dmitry Baryshkov
On Sun, 16 May 2021 at 08:24, Bjorn Andersson wrote: > > On Sun 11 Apr 19:09 CDT 2021, Dmitry Baryshkov wrote: > > > Change huge lookup table to contain just sensible entries. IRQ index is > > now not an index in the table, but just register id (multiplied by 32, > > the amount of IRQs in the

Re: [Freedreno] [PATCH] drm/msm/dp: remove most of usbpd-related remains

2021-05-16 Thread Dmitry Baryshkov
On Sun, 16 May 2021 at 08:41, Bjorn Andersson wrote: > > On Sat 15 May 14:56 CDT 2021, Dmitry Baryshkov wrote: > > > Remove most of remains of downstream usbpd code. Mainline kernel uses > > different approach for managing Type-C / USB-PD, so this remains unused. > > Do not touch usbpd callbacks