Let's bound the level of such an $f$ in two stages. Firstly, let's look at a prime $\ell \ne p$. Here there is a theorem of Livne and (independently) Carayol which says that if $\rho$ is a lifting of $\bar\rho$, the exponent of $\ell$ dividing the Artin conductor of $\rho$ is bounded (it's at most 2 more than the $\ell$-conductor of $\bar\rho$). That leaves just the power of $p$ dividing the level to be controlled; and it's easy to see that if you require $\rho|_{D_p}$ to be upper-triangular, with fixed determinant and Hodge--Tate weights, then the conductors of the characters occuring along the diagonal are bounded above and this gives you a bound on the level of $f$ at $p$.