msm8916-mainline / linux-mdss-dsi-panel-driver-generator

Generate Linux DRM panel kernel driver based on QCOM MDSS DSI device tree
GNU General Public License v2.0
53 stars 33 forks source link

Support DSC (Display Stream Compression) panels #25

Closed MarijnS95 closed 8 months ago

MarijnS95 commented 1 year ago

Just a draft for now to raise awareness about the existence of these patches, making sure existing progress is not forgotten about. I have just taken @jenneron's original DSC patch and fixed up the broken conventions in the exact same way as the upstream DPU1 driver (https://lore.kernel.org/linux-arm-msm/20221026182824.876933-1-marijn.suijten@somainline.org/). Conflicts need to be solved in a rebase and a real-world DSC panel should be tested by someone who actually uses the panel generator, rather than by me who only gets sent broken drivers generated by it and is in turn expected to "fix them plox".

z3ntu commented 9 months ago

This PR causes the following diff for non DSC panel. Especially the first one should be fixed I think, second one I don't know what the coding standard prefers.

diff --git a/drivers/gpu/drm/panel/panel-hx83112a-auo.c b/drivers/gpu/drm/panel/panel-hx83112a-auo.c
index f757d84a8608..1beca28dd59f 100644
--- a/drivers/gpu/drm/panel/panel-hx83112a-auo.c
+++ b/drivers/gpu/drm/panel/panel-hx83112a-auo.c
@@ -202,6 +202,7 @@ static int hx83112a_auo_prepare(struct drm_panel *panel)
 {
    struct hx83112a_auo *ctx = to_hx83112a_auo(panel);
    struct device *dev = &ctx->dsi->dev;
+
    int ret;

    if (ctx->prepared)
@@ -217,6 +218,7 @@ static int hx83112a_auo_prepare(struct drm_panel *panel)
    }

    ctx->prepared = true;
+
    return 0;
 }
MarijnS95 commented 9 months ago

@z3ntu thanks for noticing, looks like I inherited some more cruft when band-aiding the original code - lots of unrelated changes.

Partly caused by lmdpdg inconsistently using:

s += '''
...'''
s += '''
....'''

Versus:

s += '''...
'''
s += '''\
....
'''
z3ntu commented 9 months ago

@stephan-gh Could you review this please?

stephan-gh commented 9 months ago

Did everything necessary for this land upstream now?

MarijnS95 commented 9 months ago

@stephan-gh in the broad sense of the word, yesno? CMDmode DSC works on 95% of our Sony devices, except those with dual-DSI which is still an open topic and IMO out of scope for this PR.

Video mode might not be working yet because some upstream engineers went against all requests/warnings and put up arbitrary if cmdmode return -EINVAL; because it "was not tested yet".

stephan-gh commented 9 months ago

I guess "it compiles without extra Linux patches and generates the panel driver in the way expected upstream" would be enough for me :)

MarijnS95 commented 9 months ago

That's it :)

I'm sure we'll add more improvements over time, but this should at least get us started.

z3ntu commented 9 months ago

I can confirm now the generated panel (cmd mode oled panel using DSC) works on qcm6490-fairphone-fp5 after fixing some DPU bits, so the generated driver should be fine :)

MarijnS95 commented 9 months ago

Good news! Let's get this in before more conflicts arise?

z3ntu commented 9 months ago

Sounds good to me! @stephan-gh ?

MarijnS95 commented 9 months ago

Found another important issue in DSC version parsing, fixed now :sweat_smile:

stephan-gh commented 9 months ago

@MarijnS95 Do you prefer retaining the commit history here or should I squash it?

MarijnS95 commented 9 months ago

@stephan-gh please squash it, there's so much noise/nonsense in there that's not worth anything :grimacing:

Anyway, given the last comment/commit I should probably self-review the original code a bit more, having the right output doesn't at all mean that the implementation is anywhere remotely correct :cold_sweat:

stephan-gh commented 8 months ago

Thanks, I will wait for your confirmation then. :)

MarijnS95 commented 8 months ago

@stephan-gh done! I'm okay with it, didn't realize that this change got so small again after all the cleanups.