The proper inclusion of flavor in the Dijkgraaf-Vafa proposal for the solution of N=1 gauge theories through matrix models has been subject of debate in the recent literature. We here reexamine this issue by geometrically engineering fundamental matter with type IIB branes wrapped on non-compact cycles in the resolved geometry, and following them through the geometric transition. Our approach treats massive and massless flavor fields on equal footing, including the mesons. We also study the geometric transitions and superpotentials for finite mass of the adjoint field. All superpotentials we compute reproduce the field theory results. Crucial insights come from T-dual brane constructions in type IIA.