This paper is devoted to the analysis of a fluid queue with a buffer content that varies linearly during periods that are governed by a three-state semi-Markov process. Two cases are being distinguished: (i) two upward slopes and one downward slope, and (ii) one upward slope and two downward slopes. In both cases, at least one of the period distributions is allowed to be completely general. We obtain exact results for the buffer content distribution, the busy period distribution and the distribution of the maximal buffer content during a busy period. The results are obtained by establishing relations between the fluid queues and ordinary queues with instantaneous input, and by using level crossing theory.