One thing I can understand that you have headache for a long time. But the frequency, duration,quality of headache, intensity, associated symptoms are not mentioned. But as it’s a chronic and had started long times ago Migraine/ Vascular headache may be the most common. But recently it may has turned to chronic daily headache. Also you have mentioned a kind of fainting spells and blackout. This part is very important and requires details clarification from the eyewitness as because there may be altered consciousness inside you. By considering the above mentioned facts and history it can be a manifestation of vertiginous migraine or may be syncopal attacks or even may be a kind of partial to complex seizures. There are many possibilities even anxiety attack also.
Next Steps
I will suggest to consult a neurologist or Neuropsychiatrist at the earliest. But always visit the doctor along with a close family member or friend who has observed you during the spells. Thanks