[Tex/LaTex] Get FancyHDR and geometry to work nicely

fancyhdrgeometry

In the MWE, geometry is set to leave a top margin of 1cm on the top and on the back of the page. Yet, with FancyHDR on the top of that, occupy some parts of this margin and I have to manually tweak the margins in geometry to get an descent margin.

Is there some correction I could do to have this sorted out automatically ?
NB: I compile with xelatex.

\documentclass[twoside]{report}
\usepackage{fontspec} % 

\usepackage[hidelinks,xetex]{hyperref}

\usepackage[top=1cm,bottom=1cm,left=0.5cm,right=0.5cm,asymmetric]{geometry}
\geometry{bindingoffset=2.1cm}
\usepackage{lipsum}

\usepackage{fancyhdr}

\fancypagestyle{style}{
    \fancyhf{}                          
    \fancyhead[LE]{\leftmark} %\slshape 
    \fancyhead[RO]{\rightmark} %\slshape
    \fancyfoot[LE,RO]{\hyperlink{toc}{\thepage}}
    \renewcommand{\headrulewidth}{1pt}  
    \renewcommand{\footrulewidth}{1pt}}
\pagestyle{style}

\begin{document}
\chapter{Chapter}

\lipsum[1-30]

\end{document}

Best Answer

It actually is very easy, and I should have read the manual for geometry before asking this question. But now it is asked, all there is to do is to add includeheadfoot in the options of the geometry package and problem solved.

\documentclass[twoside]{report}
\usepackage{fontspec} % 

\usepackage[hidelinks,bookmarksnumbered,pagebackref,xetex]{hyperref}

\usepackage[top=0cm,bottom=0cm,left=0.5cm,right=0.5cm,includeheadfoot,asymmetric]{geometry}
\geometry{bindingoffset=2.1cm}
\usepackage{lipsum}

\usepackage{fancyhdr}

\fancypagestyle{style}{
    \fancyhf{}                          
    \fancyhead[LE]{\leftmark} %\slshape 
    \fancyhead[RO]{\rightmark} %\slshape
    \fancyfoot[LE,RO]{\hyperlink{toc}{\thepage}}
    \renewcommand{\headrulewidth}{1pt}  
    \renewcommand{\footrulewidth}{1pt}}
\pagestyle{style}

\begin{document}
\chapter{Chapter}

\lipsum[1-30]

\end{document}