You are looking for pairs $\displaystyle (x_1, x_2)$ which satisfy the given conditions. These pairs are represented by points which belong to the quadrilateral painted in grey (see attachment)
The maximum of P will be obtained if the line
$\displaystyle x_2 = -2x_1 + P$
passes at least through one point of the quadrilateral such that the $\displaystyle x_2-intercept$ is as great as possible. This happens if the line passes through the point Q(1, 4). Then P = 6.