Most of the genes in the mitochondria code for respiration-related proteins, and most of the genes in the chloroplasts code for photosynthesis-related proteins.
Mitochondria and chloroplasts both contain their own DNA, which codes for proteins essential to their respective functions: respiration in mitochondria and photosynthesis in chloroplasts.