Power dissipation on mosfet with PWM and current regulation
The first contribution to Pd is the power wasted as heat by the MOSFET.
The second contribution to Pd is the power wasted as heat by the led controller.
The led controller and the MOSFET are on the same chip so Pd has two contributions.
The definition of power consumption of a MOSFET is:
Pd(t) = Id(t) * Vds(t)
or
Pd(t) = Rds(t) * Id(t) * Id(t)
In a lab it's much easier to use the first formula because you can measure currents and voltages.