Skip to content

Commit

Permalink
drm: vc4: dsi: Handle the different command FIFO widths
Browse files Browse the repository at this point in the history
DSI0 and DSI1 have different widths for the command FIFO (24bit
vs 32bit), but the driver was assuming the 32bit width of DSI1
in all cases.

Handle the difference via the variant structure.

Signed-off-by: Dave Stevenson <[email protected]>
  • Loading branch information
6by9 committed Nov 20, 2024
1 parent 0e49686 commit 8bec19b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/gpu/drm/vc4/vc4_dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

#define DSI_CMD_FIFO_DEPTH 16
#define DSI_PIX_FIFO_DEPTH 256
#define DSI_PIX_FIFO_WIDTH 4

#define DSI0_CTRL 0x00

Expand Down Expand Up @@ -553,6 +552,7 @@ struct vc4_dsi_variant {
unsigned int port;

bool broken_axi_workaround;
unsigned int cmd_fifo_width;

const char *debugfs_name;
const struct debugfs_reg32 *regs;
Expand Down Expand Up @@ -1235,9 +1235,9 @@ static ssize_t vc4_dsi_transfer(struct vc4_dsi *dsi,
pix_fifo_len = 0;
} else {
cmd_fifo_len = (packet.payload_length %
DSI_PIX_FIFO_WIDTH);
dsi->variant->cmd_fifo_width);
pix_fifo_len = ((packet.payload_length - cmd_fifo_len) /
DSI_PIX_FIFO_WIDTH);
dsi->variant->cmd_fifo_width);
}

WARN_ON_ONCE(pix_fifo_len >= DSI_PIX_FIFO_DEPTH);
Expand Down Expand Up @@ -1516,20 +1516,23 @@ static const struct drm_encoder_funcs vc4_dsi_encoder_funcs = {

static const struct vc4_dsi_variant bcm2711_dsi1_variant = {
.port = 1,
.cmd_fifo_width = 4,
.debugfs_name = "dsi1_regs",
.regs = dsi1_regs,
.nregs = ARRAY_SIZE(dsi1_regs),
};

static const struct vc4_dsi_variant bcm2835_dsi0_variant = {
.port = 0,
.cmd_fifo_width = 3,
.debugfs_name = "dsi0_regs",
.regs = dsi0_regs,
.nregs = ARRAY_SIZE(dsi0_regs),
};

static const struct vc4_dsi_variant bcm2835_dsi1_variant = {
.port = 1,
.cmd_fifo_width = 4,
.broken_axi_workaround = true,
.debugfs_name = "dsi1_regs",
.regs = dsi1_regs,
Expand Down

0 comments on commit 8bec19b

Please sign in to comment.