We develop a novel decomposition of firm-level revenue based TFP growth into six separate margins: i) mean quantity based TFP growth, ii) mean growth in demand shifters iii) intensive margin specialization effects iv) product scope effects v) product adding effects, and vi) product dropping effects. To apply this decomposition, information on the allocation of inputs across product lines is needed. For this purpose, we use a novel Indian data set containing information on the allocation of energy across product lines, and show that this information is sufficient to recover the allocation of all inputs under some restrictions. We use these results to estimate and decompose firm-level revenue based TFP gains generated by increased Chinese import competition from 1991 to 2018. We find that growth in mean demand shifters is the primary driver of increases in revenue based TFP. On the other hand, mean TFPQ tends to fall in response to Chinese import competition, suggesting quality upgrading. The other margins generating TFP growth tend to be more modest on their own, although together the sum of product scope, as well intensive and extensive margin effects can account for around 40% of firm-level revenue based TFP growth due to Chinese import competition.