For DPI on a play that starts outside the 2 yard line:
Start marching. Stop when you go 15 yards, reach the spot of the foul, or reach the two yard line, whichever comes first.
If the play starts at the 2 or less, half the distance or spot of the foul, whichever is less.
In any case, automatic first down.