# brackets inside matrix / matrices inside a matrix

I would like to make something that looks like this:

I don't know how to get the brackets inside the matrix to line up in the right spots. I don't need them to be red; I just added that to emphasize what I want.

Here is what I used to make this (sans red brackets):

\begin{bmatrix}
I_p \\
& \ddots \\
&& I_p \\
& I_p \\
&& \ddots \\
&&& I_p \\
&&& \vdots & \ddots \\
&&& \ddots & \vdots \\
&&&& I_p \\
&&&&& \ddots \\
&&&&&& I_p
\end{bmatrix}


EDIT: See this followup question for the solution I went with.

Use blkarray
\documentclass{article}
$\left[ \begin{blockarray}{ccccccc} \begin{block}{[ccc]cccc} I_p \\ & \ddots \\ & & I_p \\ \end{block} \begin{block}{c[ccc]ccc} & I_p \\ & & \ddots \\ & & & I_p \\ \end{block} & & & \vdots & \ddots \\ & & & \ddots & \vdots \\ \begin{block}{cccc[ccc]} & & & & I_p \\ & & & & & \ddots \\ & & & & & & I_p \\ \end{block} \end{blockarray} \right]$