A downhole closed loop method for controlling a drilling toolface includes measuring first and second attitudes of the subterranean borehole at corresponding first and second upper and lower survey stations. The first and second attitudes are processed downhole while drilling to compute an angle change of the subterranean borehole between the upper and lower survey stations. The computed angle change is compared with a predetermined threshold. This process may be continuously repeated while the angle change is less than the threshold. The first and second attitudes are further processed downhole to compute a toolface angle when the angle change of the subterranean borehole is greater than or equal to the threshold. The toolface angle may then be further processed to control a direction of drilling of the subterranean borehole.