The upper critical field Hc2 is a fundamental measure of the pairing strength, yet there is no agreement on its magnitude and doping dependence in cuprate superconductors. We have used thermal conductivity as a direct probe of Hc2 in the cuprates YBa2Cu3Oy and YBa2Cu4O8 to show that there is no vortex liquid at T = 0, allowing us to use high-field resistivity measurements to map out the doping dependence of Hc2 across the phase diagram. Hc2(p) exhibits two peaks, each located at a critical point where the Fermi surface undergoes a transformation. The condensation energy obtained directly from Hc2, and previous Hc1 data, undergoes a 20-fold collapse below the higher critical point. These data provide quantitative information on the impact of competing phases in suppressing superconductivity in cuprates.